From 53a52d8561ebaf2b5b34a438bba4ee414a5464b5 Mon Sep 17 00:00:00 2001 From: 2977094657 <2977094657@qq.com> Date: Sun, 15 Mar 2026 17:42:45 +0800 Subject: [PATCH] fix(export): keep appmsg type-4 links clickable --- electron/services/exportService.ts | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/electron/services/exportService.ts b/electron/services/exportService.ts index dcf3956..caf9fda 100644 --- a/electron/services/exportService.ts +++ b/electron/services/exportService.ts @@ -1127,7 +1127,7 @@ class ExportService { if (xmlType === '19') return title ? `[聊天记录] ${title}` : '[聊天记录]' if (xmlType === '33' || xmlType === '36') return title ? `[小程序] ${title}` : '[小程序]' if (xmlType === '57') return title || '[引用消息]' - if (xmlType === '5' || xmlType === '49') return title ? `[链接] ${title}` : '[链接]' + if (xmlType === '4' || xmlType === '5' || xmlType === '49') return title ? `[链接] ${title}` : '[链接]' // 有 title 就返回 title if (title) return title @@ -1200,6 +1200,7 @@ class ExportService { const typeMatch = /(\d+)<\/type>/i.exec(normalized) const subType = typeMatch ? parseInt(typeMatch[1], 10) : 0 const title = this.extractXmlValue(normalized, 'title') || this.extractXmlValue(normalized, 'appname') + const linkUrl = this.extractAppMessageLinkUrl(normalized) // 群公告消息(type 87) if (subType === 87) { @@ -1258,6 +1259,9 @@ class ExportService { if (subType === 57) { return title || '[引用消息]' } + if (linkUrl) { + return title ? `[链接]${title}\n${linkUrl}` : linkUrl + } if (title) { return `[链接]${title}` } @@ -1810,6 +1814,7 @@ class ExportService { normalized.includes('') const hasReferMsg = normalized.includes('') const xmlType = this.extractAppMessageType(normalized) + const appMsgUrl = this.extractAppMessageLinkUrl(normalized) const isFinder = xmlType === '51' || normalized.includes('