WhatsApp: show all contacts in shares
This commit is contained in:
committed by
Peter Steinberger
parent
18338bc60f
commit
d1e10af1e1
@@ -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>",
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user