From 6262211af1b417291ebe101199f1fcbf1b7f381c Mon Sep 17 00:00:00 2001 From: Axel McLaren Date: Sat, 2 May 2026 07:48:41 -0700 Subject: [PATCH] Add namespacedPlatformId exclusion for DeltaChat (cherry picked from commit 5987fdc189f60b5afa76fd08c3d01ccc8a7a3a43) --- src/platform-id.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/platform-id.ts b/src/platform-id.ts index 1c4932504..dfd5568da 100644 --- a/src/platform-id.ts +++ b/src/platform-id.ts @@ -9,15 +9,17 @@ * will later emit as event.platformId, or router lookups miss and messages * get silently dropped. * - * Native adapters (Signal, WhatsApp, iMessage) use their own ID formats and - * send them as-is — no channel prefix. WhatsApp/iMessage emit JIDs/emails - * containing '@'. Signal emits raw phone numbers ('+15551234567') for DMs - * and 'group:' for group chats. Prefixing any of these would cause a - * mismatch with what the adapter later emits. + * Native adapters (Signal, WhatsApp, iMessage, DeltaChat) use their own ID + * formats and send them as-is — no channel prefix. WhatsApp/iMessage emit + * JIDs/emails containing '@'. Signal emits raw phone numbers ('+15551234567') + * for DMs and 'group:' for group chats. DeltaChat emits numeric chat IDs + * ('12'). Prefixing any of these would cause a mismatch with what the adapter + * later emits. */ export function namespacedPlatformId(channel: string, raw: string): string { if (raw.startsWith(`${channel}:`)) return raw; if (raw.includes('@')) return raw; if (raw.startsWith('+') || raw.startsWith('group:')) return raw; + if (channel === 'deltachat') return raw; return `${channel}:${raw}`; }