From 738e596c71152dbcbe4051dd3312af2cd5d2fa00 Mon Sep 17 00:00:00 2001 From: Tyler Yust Date: Sun, 25 Jan 2026 00:53:08 -0800 Subject: [PATCH] fix(bluebubbles): preserve friendly display names in formatTargetDisplay --- extensions/bluebubbles/src/channel.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/extensions/bluebubbles/src/channel.ts b/extensions/bluebubbles/src/channel.ts index 9be055908..88b8e5a2a 100644 --- a/extensions/bluebubbles/src/channel.ts +++ b/extensions/bluebubbles/src/channel.ts @@ -151,6 +151,11 @@ export const bluebubblesPlugin: ChannelPlugin = { hint: "", }, formatTargetDisplay: ({ target, display }) => { + const shouldParseDisplay = (value: string): boolean => { + if (looksLikeBlueBubblesTargetId(value)) return true; + return /^(bluebubbles:|chat_guid:|chat_id:|chat_identifier:)/i.test(value); + }; + // Helper to extract a clean handle from any BlueBubbles target format const extractCleanDisplay = (value: string | undefined): string | null => { const trimmed = value?.trim(); @@ -181,8 +186,14 @@ export const bluebubblesPlugin: ChannelPlugin = { }; // Try to get a clean display from the display parameter first - const cleanDisplay = extractCleanDisplay(display); - if (cleanDisplay) return cleanDisplay; + const trimmedDisplay = display?.trim(); + if (trimmedDisplay) { + if (!shouldParseDisplay(trimmedDisplay)) { + return trimmedDisplay; + } + const cleanDisplay = extractCleanDisplay(trimmedDisplay); + if (cleanDisplay) return cleanDisplay; + } // Fall back to extracting from target const cleanTarget = extractCleanDisplay(target);