mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-08-18 03:57:02 +08:00
feat: 修复导出任务状态并优化聊天记录导出体验
This commit is contained in:
@@ -229,12 +229,23 @@ function listSourceMessages(
|
||||
|
||||
let contentData: ReturnType<typeof parseMessageContent> | undefined
|
||||
let displayType = MSG_TYPE_DICT[msgType] || msg.messageType
|
||||
const isPatMessage = /<patMsg\b|拍了拍|拍一拍/i.test(String(content || ''))
|
||||
if (isPatMessage) {
|
||||
const system = parseMessageContent(content, 10000)
|
||||
const patContent =
|
||||
system.type === 'system'
|
||||
? { ...system, pat: true }
|
||||
: { type: 'system' as const, content: String(content || '').replace(/<[^>]+>/g, '').trim(), pat: true }
|
||||
contentData = patContent
|
||||
content = patContent.content
|
||||
displayType = '系统消息'
|
||||
}
|
||||
const inferredMsgType =
|
||||
typeof content === 'string' &&
|
||||
/<appmsg\b|<refermsg\b|<appmsg\b|<refermsg\b/i.test(content)
|
||||
? 49
|
||||
: msgType
|
||||
if ([3, 42, 43, 47, 48, 49, 50, 10000, 10002].includes(inferredMsgType)) {
|
||||
if (!isPatMessage && [3, 42, 43, 47, 48, 49, 50, 10000, 10002].includes(inferredMsgType)) {
|
||||
try {
|
||||
const isQuotePayload = /<refermsg\b/i.test(content)
|
||||
const hasStickerHints =
|
||||
|
||||
@@ -408,6 +408,9 @@ export class RecallArchiveMonitor {
|
||||
}
|
||||
|
||||
handleDatabaseChange(payload: string): void {
|
||||
// Ordinary message inserts are already visible in the main reader. The
|
||||
// archive scan is only needed when the native event indicates a recall.
|
||||
if (!/(recall|revoke|revokemsg|撤回)/i.test(String(payload || ''))) return
|
||||
const groups = this.conversationContacts()
|
||||
const knownMd5 = new Set(groups.map((contact) => contact.md5.toLowerCase()))
|
||||
const payloadTargets = extractChangedConversationMd5(payload).filter((md5) => knownMd5.has(md5))
|
||||
|
||||
Reference in New Issue
Block a user