fix: gate group activation by owner
This commit is contained in:
1 parent
1bad96aa2b
commit
85549ac3b6
2 files changed
+10
-2
No files matched your search
@@ -89,7 +89,11 @@ export function buildCommandContext(params: {
|
||||
const ownerList = ownerCandidates
|
||||
.map((entry) => normalizeE164(entry))
|
||||
.filter((entry): entry is string => Boolean(entry));
|
||||
const isAuthorizedSender = commandAuthorized;
|
||||
const isOwner =
|
||||
!isWhatsAppSurface ||
|
||||
ownerList.length === 0 ||
|
||||
(senderE164 ? ownerList.includes(senderE164) : false);
|
||||
const isAuthorizedSender = commandAuthorized && isOwner;
|
||||
|
||||
return {
|
||||
surface,
|
||||
|
||||
Reference in new issue
Block a user