feat: expose URL for link messages (app_type=5)#7
Open
fengcunhan wants to merge 1 commit intohuohuoer:mainfrom
Open
feat: expose URL for link messages (app_type=5)#7fengcunhan wants to merge 1 commit intohuohuoer:mainfrom
fengcunhan wants to merge 1 commit intohuohuoer:mainfrom
Conversation
Link messages previously only printed the title, hiding the actual URL stored in <appmsg><url>. This made it impossible to retrieve the original link target without querying the database directly. Append the URL on an indented continuation line, matching the existing pattern used for file messages and quoted messages.
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.
Summary
链接消息(
app_type == 5)此前只输出[链接] 标题,把<appmsg><url>字段丢弃了。这导致从 CLI / LLM 端无法拿到原始链接,只能直接查数据库。本 PR 在
_format_app_message_text中读取<url>,并以缩进续行的方式附加在标题之后 —— 沿用现有的[文件]和引用消息的展示风格。Diff
```diff
if app_type == 5:
```
Before / After
Before:
```
[2026-04-26 20:04] zartbot: [链接] DeepSeek-V4详细分析(1): 算法和模型结构
```
After:
```
[2026-04-26 20:04] zartbot: [链接] DeepSeek-V4详细分析(1): 算法和模型结构
http://mp.weixin.qq.com/s?__biz=...
```
Test plan
wechat-cli history <chat> --type link输出包含 URL--format json/--format text两种格式均生效(共享_format_message_text调用链)[链接] 标题)