diff --git a/extensions/ringcentral/README.md b/extensions/ringcentral/README.md index 2207e0016..509955df2 100644 --- a/extensions/ringcentral/README.md +++ b/extensions/ringcentral/README.md @@ -78,6 +78,10 @@ export RINGCENTRAL_JWT="your-jwt-token" | `allowOtherChats` | boolean | `false` | In selfOnly mode, allow chats other than Personal | | `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`) | + +> **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. ## Usage diff --git a/extensions/ringcentral/src/monitor.ts b/extensions/ringcentral/src/monitor.ts index 91c2f8bbb..e3106cfbb 100644 --- a/extensions/ringcentral/src/monitor.ts +++ b/extensions/ringcentral/src/monitor.ts @@ -330,17 +330,15 @@ async function processMessageWithPipeline(params: { } } - if (!isGroup) { + // DM policy checks - skip entirely in selfOnly mode (owner is always allowed) + if (!isGroup && !selfOnly) { const dmEnabled = account.config.dm?.enabled !== false; if (dmPolicy === "disabled" || !dmEnabled) { logVerbose(core, runtime, `Blocked RingCentral DM from ${senderId} (dmPolicy=disabled)`); return; } - // In selfOnly mode, always allow the owner - const isOwner = selfOnly && ownerId && senderId === ownerId; - - if (dmPolicy !== "open" && !isOwner) { + if (dmPolicy !== "open") { const allowed = senderAllowedForCommands; if (!allowed) { if (dmPolicy === "pairing") {