WhatsApp: show all contacts in shares

This commit is contained in:
Mahmoud Ibrahim
2026-01-10 01:45:24 +02:00
committed by Peter Steinberger
parent 18338bc60f
commit d1e10af1e1
2 changed files with 2 additions and 5 deletions

View File

@@ -124,7 +124,7 @@ describe("web inbound helpers", () => {
},
} as unknown as import("@whiskeysockets/baileys").proto.IMessage);
expect(body).toBe(
"<contacts: Alice, +15555550101, Bob, +15555550102, Charlie, +15555550103 (+1 more) +1 more>",
"<contacts: Alice, +15555550101, Bob, +15555550102, Charlie, +15555550103 (+1 more), Dana, +15555550105>",
);
});

View File

@@ -801,10 +801,7 @@ function formatContactsPlaceholder(labels: string[], total: number): string {
const suffix = total === 1 ? "contact" : "contacts";
return `<contacts: ${total} ${suffix}>`;
}
const shown = cleaned.slice(0, 3);
const remaining = Math.max(total - shown.length, 0);
const suffix = remaining > 0 ? ` +${remaining} more` : "";
return `<contacts: ${shown.join(", ")}${suffix}>`;
return `<contacts: ${cleaned.join(", ")}>`;
}
function formatContactLabel(