mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-09 03:03:24 +08:00
fix(whatsapp): handle group mentions and caller allowlists
This commit is contained in:
parent
54468bbe1e
commit
9664e85599
13 changed files with 563 additions and 214 deletions
|
|
@ -53,8 +53,8 @@ function payloadFailure(endpoint, payload) {
|
|||
&& payload.confirm === true ? null : 'bot.delete requires a botId and confirm=true.';
|
||||
}
|
||||
if (endpoint === WHATSAPP_ENDPOINTS.setAccessPolicy) {
|
||||
if (!exactKeys(payload, ['botId', 'accessMode', 'allowedNumbers'])
|
||||
|| Object.keys(payload).length !== 3
|
||||
if (!exactKeys(payload, ['botId', 'accessMode', 'allowedNumbers', 'groupAllowedNumbers'])
|
||||
|| Object.keys(payload).length !== 4
|
||||
|| !validId(payload.botId)) return '请输入有效的 WhatsApp 访问模式和电话号码。';
|
||||
try {
|
||||
normalizeWhatsappAccessPolicy(payload);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue