mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-03-24 23:06:51 +00:00
Align HTML export parsing and voip placeholders
This commit is contained in:
@@ -348,6 +348,9 @@ class ExportService {
|
|||||||
this.extractXmlValue(normalized, 'name')
|
this.extractXmlValue(normalized, 'name')
|
||||||
return location ? `[定位]${location}` : '[定位]'
|
return location ? `[定位]${location}` : '[定位]'
|
||||||
}
|
}
|
||||||
|
if (localType === 50) {
|
||||||
|
return this.parseVoipMessage(safeContent)
|
||||||
|
}
|
||||||
if (localType === 10000 || localType === 266287972401) {
|
if (localType === 10000 || localType === 266287972401) {
|
||||||
return this.cleanSystemMessage(safeContent)
|
return this.cleanSystemMessage(safeContent)
|
||||||
}
|
}
|
||||||
@@ -667,31 +670,15 @@ class ExportService {
|
|||||||
private formatHtmlMessageText(content: string, localType: number): string {
|
private formatHtmlMessageText(content: string, localType: number): string {
|
||||||
if (!content) return ''
|
if (!content) return ''
|
||||||
|
|
||||||
const normalized = this.normalizeAppMessageContent(content)
|
if (localType === 1) {
|
||||||
const isAppMessage = normalized.includes('<appmsg') || normalized.includes('<msg>')
|
return this.stripSenderPrefix(content)
|
||||||
|
|
||||||
if (localType === 49 || isAppMessage) {
|
|
||||||
const typeMatch = /<type>(\d+)<\/type>/i.exec(normalized)
|
|
||||||
const subType = typeMatch ? parseInt(typeMatch[1], 10) : 0
|
|
||||||
const title = this.extractXmlValue(normalized, 'title') || this.extractXmlValue(normalized, 'appname')
|
|
||||||
if (subType === 6) {
|
|
||||||
const fileName = this.extractXmlValue(normalized, 'filename') || title || '文件'
|
|
||||||
return `[文件] ${fileName}`.trim()
|
|
||||||
}
|
|
||||||
if (subType === 33 || subType === 36) {
|
|
||||||
const appName = this.extractXmlValue(normalized, 'appname')
|
|
||||||
const miniTitle = title || appName || '小程序'
|
|
||||||
return `[小程序] ${miniTitle}`.trim()
|
|
||||||
}
|
|
||||||
return title || '[链接]'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (localType === 42) {
|
if (localType === 34) {
|
||||||
const nickname = this.extractXmlValue(normalized, 'nickname')
|
return this.parseMessageContent(content, localType) || ''
|
||||||
return nickname ? `[名片] ${nickname}` : '[名片]'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.parseMessageContent(content, localType) || ''
|
return this.formatPlainExportContent(content, localType, { exportVoiceAsText: false })
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2501,7 +2488,7 @@ class ExportService {
|
|||||||
if (msg.localType === 34 && useVoiceTranscript) {
|
if (msg.localType === 34 && useVoiceTranscript) {
|
||||||
textContent = voiceTranscriptMap.get(msg.localId) || '[语音消息 - 转文字失败]'
|
textContent = voiceTranscriptMap.get(msg.localId) || '[语音消息 - 转文字失败]'
|
||||||
}
|
}
|
||||||
if (mediaItem && (msg.localType === 3 || msg.localType === 43 || msg.localType === 47)) {
|
if (mediaItem && (msg.localType === 3 || msg.localType === 47)) {
|
||||||
textContent = ''
|
textContent = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user