feat(appmsg): 支持引用消息原文解析#28
Open
hqhq1025 wants to merge 2 commits intojackwener:mainfrom
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
WeChat 4.x 的引用消息是
type=57的 appmsg,真实local_type会编码成57<<32 | 49。现有输出只能显示[引用] <title>,没有解析<refermsg>里的原消息内容;同时history/search --type link|file用local_type = 49精确匹配,会漏掉这些编码后的引用消息。改动
type=57引用消息优先解析<refermsg><content>,并带上<displayname>,输出为:[引用] 当前消息↳ 发送者: 被引用内容history/search的消息类型过滤改为比较低 32 位:(local_type & 4294967295) = ?search --type link|file对 appmsg 行先解压并格式化,再按可见内容匹配,支持搜到压缩 BLOB 里引用原文的关键词真实数据验证
用本地真实聊天记录
赵一诺验证:{ "quote_output_count": 133, "with_ref_line": 133, "sample": { "content": "[引用] 诶呀\n ↳ 不再熬夜: 对这个是啥", "local_id": 14807, "time": "2026-05-04 15:06", "type": "链接/文件" } }history '赵一诺' --type link:total=1178,quote_count=738,with_ref_line=738。search 'claude' --in '赵一诺' --type link能搜到引用原文里的claude:验证
跨平台 check 在当前 macOS 环境未跑到项目 Rust 代码: