fix(web): show all WhatsApp shared contacts
This commit is contained in:
@@ -141,7 +141,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>",
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -801,9 +801,9 @@ function formatContactsPlaceholder(labels: string[], total: number): string {
|
||||
const suffix = total === 1 ? "contact" : "contacts";
|
||||
return `<contacts: ${total} ${suffix}>`;
|
||||
}
|
||||
const { shown, remaining } = summarizeList(cleaned, total, 3);
|
||||
const remaining = Math.max(total - cleaned.length, 0);
|
||||
const suffix = remaining > 0 ? ` +${remaining} more` : "";
|
||||
return `<contacts: ${shown.join(", ")}${suffix}>`;
|
||||
return `<contacts: ${cleaned.join(", ")}${suffix}>`;
|
||||
}
|
||||
|
||||
function formatContactLabel(
|
||||
|
||||
Reference in New Issue
Block a user