mirror of https://github.com/openclaw/openclaw.git
fix(whatsapp): record channel activity only after access control passes for reactions
This commit is contained in:
parent
f1d5a70223
commit
631d1ff833
|
|
@ -466,12 +466,6 @@ export async function monitorWebInbox(options: {
|
|||
if (!resolvedFrom) continue;
|
||||
const from = resolvedFrom;
|
||||
|
||||
recordChannelActivity({
|
||||
channel: "whatsapp",
|
||||
accountId: options.accountId,
|
||||
direction: "inbound",
|
||||
});
|
||||
|
||||
// Derive isFromMe from reactor identity, not key.fromMe.
|
||||
// key.fromMe on a reaction refers to whether the *reacted-to message* was from us,
|
||||
// not whether the reactor is us. Compare JIDs directly instead.
|
||||
|
|
@ -497,6 +491,14 @@ export async function monitorWebInbox(options: {
|
|||
});
|
||||
if (!access.allowed) continue;
|
||||
|
||||
// Only record activity for reactions that pass access control — consistent with
|
||||
// handleMessagesUpsert and prevents blocked/self reactions from inflating inbound metrics.
|
||||
recordChannelActivity({
|
||||
channel: "whatsapp",
|
||||
accountId: options.accountId,
|
||||
direction: "inbound",
|
||||
});
|
||||
|
||||
const reactedMessageId = key?.id ?? undefined;
|
||||
const chatJid = remoteJid;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue