feat(pairing): show sender ids across providers

This commit is contained in:
Peter Steinberger
2026-01-08 23:19:13 +00:00
parent 7c7858a519
commit e0439df4ce
13 changed files with 156 additions and 2 deletions

View File

@@ -313,6 +313,8 @@ export async function monitorWebInbox(options: {
text: [
"Clawdbot: access not configured.",
"",
`Your WhatsApp sender id: ${candidate}`,
"",
`Pairing code: ${code}`,
"",
"Ask the bot owner to approve with:",

View File

@@ -670,6 +670,9 @@ describe("web monitor inbox", () => {
// Should NOT send read receipts for blocked senders (privacy + avoids Baileys Bad MAC churn).
expect(sock.readMessages).not.toHaveBeenCalled();
expect(sock.sendMessage).toHaveBeenCalledTimes(1);
expect(sock.sendMessage).toHaveBeenCalledWith("999@s.whatsapp.net", {
text: expect.stringContaining("Your WhatsApp sender id: +999"),
});
expect(sock.sendMessage).toHaveBeenCalledWith("999@s.whatsapp.net", {
text: expect.stringContaining("Pairing code: PAIRCODE"),
});
@@ -1121,6 +1124,9 @@ describe("web monitor inbox", () => {
await new Promise((resolve) => setImmediate(resolve));
expect(onMessage).not.toHaveBeenCalled();
expect(sock.sendMessage).toHaveBeenCalledTimes(1);
expect(sock.sendMessage).toHaveBeenCalledWith("999@s.whatsapp.net", {
text: expect.stringContaining("Your WhatsApp sender id: +999"),
});
expect(sock.sendMessage).toHaveBeenCalledWith("999@s.whatsapp.net", {
text: expect.stringContaining("Pairing code: PAIRCODE"),
});
@@ -1274,6 +1280,9 @@ describe("web monitor inbox", () => {
expect(onMessage).not.toHaveBeenCalled();
expect(upsertPairingRequestMock).toHaveBeenCalledTimes(1);
expect(sock.sendMessage).toHaveBeenCalledWith("999@s.whatsapp.net", {
text: expect.stringContaining("Your WhatsApp sender id: +999"),
});
expect(sock.sendMessage).toHaveBeenCalledWith("999@s.whatsapp.net", {
text: expect.stringContaining("Pairing code: PAIRCODE"),
});