fix: tighten WhatsApp ack reactions and migrate config (#629) (thanks @pasogott)
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user