From 69f64c98445c739088ee3dfd464dd688ec27e7d4 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Wed, 30 Sep 2026 18:13:37 +0200 Subject: [PATCH] fix: channel mention notification shows raw mention markup with the user id (#31601) When someone mentioned a user or channel in a channel message, the notification toast and the browser notification showed the raw mention markup, including the internal id. They now show the mention the same way the message does in the channel, for example "@Alex". Fixes #31586 --- src/routes/+layout.svelte | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index a3272177af..c855db529c 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -882,6 +882,10 @@ if (type === 'message') { const title = `${data?.user?.name}${event?.channel?.type !== 'dm' ? ` (#${event?.channel?.name})` : ''}`; + const content = data?.content?.replace( + /<([@#])([^|>\s]+)(?:\|([^>]*))?>/g, + (_, trigger, id, label) => trigger + (label || id) + ); if ($isLastActiveTab) { if ($settings?.notificationEnabled ?? false) { @@ -889,7 +893,7 @@ // Do not alter, remove, obscure, or replace it except as LICENSE permits: // https://docs.openwebui.com/license. new Notification(`${title} / Open WebUI`, { - body: data?.content, + body: content, icon: `${WEBUI_API_BASE_URL}/users/${data?.user?.id}/profile/image` }); } @@ -902,7 +906,7 @@ `/channels/${event.channel_id}${data?.parent_id ? `?thread=${data.parent_id}` : ''}` ); }, - content: data?.content, + content, title: `${title}` }, duration: 15000,