fix: tighten WhatsApp ack reactions and migrate config (#629) (thanks @pasogott)

This commit is contained in:
Peter Steinberger
2026-01-11 04:09:14 +01:00
parent c928df7237
commit 38604acd94
7 changed files with 125 additions and 97 deletions

View File

@@ -76,6 +76,17 @@ describe("WhatsApp ack reaction logic", () => {
}),
).toBe(false);
});
it("should not react when message id is missing", () => {
const cfg: ClawdbotConfig = {
whatsapp: { ackReaction: { emoji: "👀", direct: true } },
};
expect(
shouldSendReaction(cfg, {
chatType: "direct",
}),
).toBe(false);
});
});
describe("group chat - always mode", () => {
@@ -257,4 +268,18 @@ describe("WhatsApp ack reaction logic", () => {
).toBe(true);
});
});
describe("legacy config is ignored", () => {
it("does not use messages.ackReaction for WhatsApp", () => {
const cfg: ClawdbotConfig = {
messages: { ackReaction: "👀", ackReactionScope: "all" },
};
expect(
shouldSendReaction(cfg, {
id: "m1",
chatType: "direct",
}),
).toBe(false);
});
});
});