refactor: share inbound envelope label helper

This commit is contained in:
Peter Steinberger
2026-01-17 08:51:26 +00:00
parent 61e60f3b84
commit 1002c74d9c
4 changed files with 46 additions and 16 deletions

View File

@@ -46,4 +46,11 @@ describe("formatInboundBodyWithSenderMeta", () => {
const ctx: MsgContext = { ChatType: "group", SenderName: "Alice", SenderId: "A1" };
expect(formatInboundBodyWithSenderMeta({ ctx, body: "Alice (A1): hi" })).toBe("Alice (A1): hi");
});
it("does not append when the sender prefix follows an envelope header", () => {
const ctx: MsgContext = { ChatType: "group", SenderName: "Alice", SenderId: "A1" };
expect(formatInboundBodyWithSenderMeta({ ctx, body: "[Signal Group] Alice (A1): hi" })).toBe(
"[Signal Group] Alice (A1): hi",
);
});
});