diff --git a/extensions/ringcentral/README.md b/extensions/ringcentral/README.md index 509955df2..ebaa6ae5d 100644 --- a/extensions/ringcentral/README.md +++ b/extensions/ringcentral/README.md @@ -74,14 +74,13 @@ export RINGCENTRAL_JWT="your-jwt-token" | `clientSecret` | string | - | RingCentral app client secret | | `jwt` | string | - | JWT token for authentication | | `server` | string | `https://platform.ringcentral.com` | RingCentral API server URL | -| `selfOnly` | boolean | `true` | Only accept messages from the JWT user | -| `allowOtherChats` | boolean | `false` | In selfOnly mode, allow chats other than Personal | +| `selfOnly` | boolean | `true` | Only respond to JWT user in Personal chat | | `name` | string | - | Bot display name | | `textChunkLimit` | number | `4000` | Maximum characters per message chunk | -| `dmPolicy` | string | `"pairing"` | DM policy (only applies when `selfOnly: false`) | -| `groupPolicy` | string | `"allowlist"` | Group policy (only applies when `selfOnly: false`) | +| `dmPolicy` | string | `"pairing"` | DM policy (only when `selfOnly: false`) | +| `groupPolicy` | string | `"allowlist"` | Group policy (only when `selfOnly: false`) | -> **Note:** When `selfOnly: true` (default), the `dmPolicy`, `allowFrom`, `groupPolicy`, and related settings are ignored. The bot only responds to the JWT user in their Personal chat. +> **Note:** When `selfOnly: true` (default), the bot only responds to the JWT user in their Personal chat. All other policy settings (`dmPolicy`, `allowFrom`, `groupPolicy`, etc.) are ignored. ## Usage diff --git a/extensions/ringcentral/src/config-schema.ts b/extensions/ringcentral/src/config-schema.ts index f7b37e0d7..f8ba0fd93 100644 --- a/extensions/ringcentral/src/config-schema.ts +++ b/extensions/ringcentral/src/config-schema.ts @@ -44,7 +44,6 @@ const RingCentralAccountSchemaBase = z allowBots: z.boolean().optional(), botExtensionId: z.string().optional(), selfOnly: z.boolean().optional(), - allowOtherChats: z.boolean().optional(), }) .strict(); diff --git a/extensions/ringcentral/src/monitor.ts b/extensions/ringcentral/src/monitor.ts index e3106cfbb..97d728ecc 100644 --- a/extensions/ringcentral/src/monitor.ts +++ b/extensions/ringcentral/src/monitor.ts @@ -226,14 +226,10 @@ async function processMessageWithPipeline(params: { const isGroup = chatType !== "Direct" && chatType !== "PersonalChat" && chatType !== "Personal"; runtime.log?.(`[${account.accountId}] Chat type: ${chatType}, isGroup: ${isGroup}`); - // In selfOnly mode, by default only allow "Personal" chat (conversation with yourself) - // Set allowOtherChats: true to allow DMs and groups - if (selfOnly) { - const allowOtherChats = account.config.allowOtherChats === true; // default false - if (!allowOtherChats && !isPersonalChat) { - logVerbose(core, runtime, `ignore non-personal chat in selfOnly mode: chatType=${chatType}`); - return; - } + // In selfOnly mode, only allow "Personal" chat (conversation with yourself) + if (selfOnly && !isPersonalChat) { + logVerbose(core, runtime, `ignore non-personal chat in selfOnly mode: chatType=${chatType}`); + return; } const defaultGroupPolicy = config.channels?.defaults?.groupPolicy; diff --git a/extensions/ringcentral/src/types.ts b/extensions/ringcentral/src/types.ts index a53f9246c..847269c70 100644 --- a/extensions/ringcentral/src/types.ts +++ b/extensions/ringcentral/src/types.ts @@ -114,8 +114,7 @@ export type RingCentralAccountConfig = { allowBots?: boolean; botExtensionId?: string; replyToMode?: "off" | "all"; - selfOnly?: boolean; // JWT mode: only accept messages from the JWT user (default: true) - allowOtherChats?: boolean; // In selfOnly mode, allow chats other than Personal (default: false) + selfOnly?: boolean; // JWT mode: only accept messages from the JWT user in Personal chat (default: true) }; export type RingCentralConfig = RingCentralAccountConfig & {