chore: format + regenerate protocol

This commit is contained in:
Peter Steinberger
2026-01-17 03:40:49 +00:00
parent 09bed2ccde
commit a82217a5f3
20 changed files with 79 additions and 74 deletions

View File

@@ -11,7 +11,9 @@ describe("formatInboundBodyWithSenderMeta", () => {
it("appends a sender meta line for non-direct messages", () => {
const ctx: MsgContext = { ChatType: "group", SenderName: "Alice", SenderId: "A1" };
expect(formatInboundBodyWithSenderMeta({ ctx, body: "[X] hi" })).toBe("[X] hi\n[from: Alice (A1)]");
expect(formatInboundBodyWithSenderMeta({ ctx, body: "[X] hi" })).toBe(
"[X] hi\n[from: Alice (A1)]",
);
});
it("prefers SenderE164 in the label when present", () => {
@@ -21,7 +23,9 @@ describe("formatInboundBodyWithSenderMeta", () => {
SenderId: "bob@s.whatsapp.net",
SenderE164: "+222",
};
expect(formatInboundBodyWithSenderMeta({ ctx, body: "[X] hi" })).toBe("[X] hi\n[from: Bob (+222)]");
expect(formatInboundBodyWithSenderMeta({ ctx, body: "[X] hi" })).toBe(
"[X] hi\n[from: Bob (+222)]",
);
});
it("preserves escaped newline style when body uses literal \\\\n", () => {
@@ -38,4 +42,3 @@ describe("formatInboundBodyWithSenderMeta", () => {
);
});
});