<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[修改 forkgram/tdesktop 实现 跳转到前一条后一条@我的消息]]></title><description><![CDATA[<h3>前言</h3>
<p dir="auto">我们之前已经实现了 <a href="https://zelikk.blogspot.com/2026/07/forkgram-tdesktop-at-me-on-top.html" rel="nofollow ugc">有@我消息的群 置顶</a> 方便我们"快速到达战场"</p>
<p dir="auto">又进一步实现了 <a href="https://zelikk.blogspot.com/2026/08/forkgram-goto-last-mention.html" rel="nofollow ugc">跳转到最后一条@我的消息</a></p>
<p dir="auto">但是, 如果群组里面新 @我的消息多于一条呢?</p>
<h3>面向Agent开发</h3>
<p dir="auto">Hermes 对接 oc/deepseek-v4-flash-free</p>
<p dir="auto"><a href="https://zelikk.blogspot.com/2026/08/omniroute-hermes-agent-oracle-arm-ubuntu-root-sudo-.html" rel="nofollow ugc">https://zelikk.blogspot.com/2026/08/omniroute-hermes-agent-oracle-arm-ubuntu-root-sudo-.html</a></p>
<p dir="auto">下面的引用框里面都是我发给Agent的自然语言</p>
<blockquote>
<p dir="auto">基于 <code>https://github.com/crazypeace/forkgram-tdesktop/tree/goto-last-mention</code> 的代码, 进行增强开发</p>
<p dir="auto">当 点击 "Go to the last msg mentioned me" 之后, 实现了跳转消息的效果,</p>
<p dir="auto">然后, 在这个时候, 再次点击 "Go to the last msg mentioned me", 希望能继续跳转到再上一条 @消息</p>
<p dir="auto">你说一下你是怎么理解 我的需求的, 与我讨论.</p>
</blockquote>
<p dir="auto">Agent分析了一通, 问我, 向前跳转的时候, 以什么为锚点?</p>
<p dir="auto">是把上一次跳转的消息id保存下来, 作为锚点?</p>
<p dir="auto">还是以当前群组消息视口可见的消息为锚点?</p>
<blockquote>
<p dir="auto">锚点=当前视口</p>
<p dir="auto">把原来的 "Go to the last message mentioned me" 菜单项 改为 "Go to the Pre msg <a class="plugin-mentions-user plugin-mentions-a" href="/user/me" aria-label="Profile: me">@<bdi>me</bdi></a>"</p>
<p dir="auto">效果为, 以当前视口为锚点, 跳转上一条 @我 的消息</p>
<p dir="auto">增加一项 "Go to the Next msg <a class="plugin-mentions-user plugin-mentions-a" href="/user/me" aria-label="Profile: me">@<bdi>me</bdi></a>"</p>
<p dir="auto">效果为, 以当前视口为锚点, 跳转下一条 @我 的消息</p>
</blockquote>
<h3>成果</h3>
<p dir="auto">群组菜单</p>
<p dir="auto"><img src="https://upload.lcz.me/uploads/9630617d-2ec6-4bb9-a374-ae3c8ebec32d.jpeg" alt="c4358f0e-b7dc-4587-b102-751ae5a263af-image.jpeg" class=" img-fluid img-markdown" /></p>
<p dir="auto">跳转效果</p>
<p dir="auto"><img src="https://private-user-images.githubusercontent.com/665889/633739377-e4ebc5e1-1074-4c16-9d69-8d35076a7135.gif?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODY0MDQxNzAsIm5iZiI6MTc4NjQwMzg3MCwicGF0aCI6Ii82NjU4ODkvNjMzNzM5Mzc3LWU0ZWJjNWUxLTEwNzQtNGMxNi05ZDY5LThkMzUwNzZhNzEzNS5naWY_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwODEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDgxMFQyMzE3NTBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1iZmVhYjI5ZjYxOTM2Mzg3ZTczZTAyNWEyMjkyOGM1ZGI1MWQ1MTU1ODZhY2JkNTQzZTQzZDY5YjliZjc5ZjU3JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZyZXNwb25zZS1jb250ZW50LXR5cGU9aW1hZ2UlMkZnaWYifQ.lm3XBM5dLTN_VcR-vXfvFa6SdGKlSBCNb1emk-zAAd4" alt="替代文字" class=" img-fluid img-markdown" /></p>
<p dir="auto"><code>https://www.youtube.com/watch?v=Rwl81yzRdms</code></p>
<h3>Github</h3>
<p dir="auto">代码</p>
<p dir="auto"><a href="https://github.com/crazypeace/forkgram-tdesktop/tree/goto-pre-next-mention" rel="nofollow ugc">https://github.com/crazypeace/forkgram-tdesktop/tree/goto-pre-next-mention</a></p>
<p dir="auto">Release</p>
<p dir="auto"><a href="https://github.com/crazypeace/forkgram-tdesktop/releases/tag/goto-pre-next-mention" rel="nofollow ugc">https://github.com/crazypeace/forkgram-tdesktop/releases/tag/goto-pre-next-mention</a></p>
<p dir="auto">========</p>
<h3>后记</h3>
<p dir="auto">跳转下一条 @我 的消息 这个功能有缺陷</p>
<p dir="auto">Telegram API里面, 搜索群组消息是 messages.search, 这个API只能从指定消息id往 旧时间的方向搜索, 不能往新时间的方向搜索. 所以严格意义上这个功能是无法实现的.</p>
<p dir="auto">现在实施的本质算法是:<br />
先从群组的最新消息作为锚点, 向旧时间的方向搜索10条 @我 的消息, 得到这些消息的id; (1)<br />
获取当前群组消息视口可见的消息id; (2)<br />
从 (1) 中得到的 10个 消息id中, 找到刚好比 (2) 的id 大的那一个, 跳转.</p>
<p dir="auto">换句话说, "跳转下一条 @我 的消息 这个功能" 只在群组最后10条@我的消息范围内有效.</p>
]]></description><link>https://lcz.me/topic/1079/修改-forkgram-tdesktop-实现-跳转到前一条后一条@我的消息</link><generator>RSS for Node</generator><lastBuildDate>Tue, 11 Aug 2026 14:53:05 GMT</lastBuildDate><atom:link href="https://lcz.me/topic/1079.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 10 Aug 2026 23:19:12 GMT</pubDate><ttl>60</ttl></channel></rss>