Skip to content

feat: expose url field for link/appmsg messages#18

Open
LegendLeo wants to merge 2 commits intojackwener:mainfrom
LegendLeo:feat/link-url-field
Open

feat: expose url field for link/appmsg messages#18
LegendLeo wants to merge 2 commits intojackwener:mainfrom
LegendLeo:feat/link-url-field

Conversation

@LegendLeo
Copy link
Copy Markdown

问题

wx history / wx search 输出的链接消息(local_type=49)只有标题,没有 URL,导致无法直接跳转原文。

方案

src/daemon/query.rs 中新增 extract_appmsg_url() 函数,解析 appmsg XML 中的 <url> 字段(fallback 到 <url1>),并在 query_messagessearch_in_table 的输出 JSON 中附加 url 字段。

  • 只对 local_type & 0xFFFFFFFF == 49 的消息提取
  • URL 为空或非 http 时省略该字段(不输出 null)
  • 不改变现有函数签名,改动最小

输出变化

修复前:

content: "[链接] 我把微信 cli 开源了!"
type: 链接/文件

修复后:

content: "[链接] 我把微信 cli 开源了!"
type: 链接/文件
url: "https://mp.weixin.qq.com/s?__biz=..."

tsinghu and others added 2 commits April 21, 2026 15:03
Extract <url> from appmsg XML in type-49 messages and append it as
a 'url' field in history/search output. The field is omitted when
the message has no valid URL (non-link types, empty, non-http).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants