From f1284e2a39e21331c5d717d65a3a2b529eab97ba Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Sun, 7 May 2023 14:07:03 +0800 Subject: [PATCH] refactor: serialize receive message for notify --- client/web/plugins/com.msgbyte.notify/src/notify.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/web/plugins/com.msgbyte.notify/src/notify.ts b/client/web/plugins/com.msgbyte.notify/src/notify.ts index 8eb22b27..998875be 100644 --- a/client/web/plugins/com.msgbyte.notify/src/notify.ts +++ b/client/web/plugins/com.msgbyte.notify/src/notify.ts @@ -6,6 +6,7 @@ import { navigate, sharedEvent, getCachedUserSettings, + getMessageTextDecorators, } from '@capital/common'; import { Translate } from './translate'; import { incBubble, setBubble } from './bubble'; @@ -59,7 +60,7 @@ export function initNotify() { ]).then(([userInfo, scopeName]) => { const nickname = userInfo?.nickname ?? ''; const icon = userInfo?.avatar ?? undefined; - const content = message.content; + const content = getMessageTextDecorators().serialize(message.content); // 只显示无富文本形式的消息 const title = `${Translate.from} [${scopeName}] ${nickname}`; const options: NotificationOptions = {