mirror of https://github.com/openclaw/openclaw.git
fix(telegram): allow target approvals fallback
This commit is contained in:
parent
6f5e71fdbc
commit
c563cdc901
|
|
@ -13,6 +13,7 @@ import {
|
|||
isTelegramExecApprovalApprover,
|
||||
isTelegramExecApprovalAuthorizedSender,
|
||||
isTelegramExecApprovalClientEnabled,
|
||||
isTelegramExecApprovalTargetRecipient,
|
||||
resolveTelegramExecApprovalTarget,
|
||||
shouldHandleTelegramExecApprovalRequest,
|
||||
} from "./exec-approvals.js";
|
||||
|
|
@ -115,6 +116,9 @@ const resolveTelegramApproveCommandBehavior: NonNullable<
|
|||
if (isTelegramExecApprovalClientEnabled({ cfg, accountId })) {
|
||||
return undefined;
|
||||
}
|
||||
if (isTelegramExecApprovalTargetRecipient({ cfg, accountId, senderId })) {
|
||||
return undefined;
|
||||
}
|
||||
if (
|
||||
isTelegramExecApprovalAuthorizedSender({ cfg, accountId, senderId }) &&
|
||||
!isTelegramExecApprovalApprover({ cfg, accountId, senderId })
|
||||
|
|
|
|||
|
|
@ -499,6 +499,9 @@ const telegramCommandTestPlugin: ChannelPlugin = {
|
|||
if (isTelegramExecApprovalClientEnabled({ cfg, accountId })) {
|
||||
return undefined;
|
||||
}
|
||||
if (isTelegramExecApprovalTargetRecipient({ cfg, accountId, senderId })) {
|
||||
return undefined;
|
||||
}
|
||||
if (
|
||||
isTelegramExecApprovalAuthorizedSender({ cfg, accountId, senderId }) &&
|
||||
!getTelegramExecApprovalApprovers({ cfg, accountId }).includes(senderId?.trim() ?? "")
|
||||
|
|
|
|||
Loading…
Reference in New Issue