Mentions in remote fediverse posts link to their account (v7.207.0) - #1258
Merged
Conversation
A Mastodon post shown here renders a mention as the bare short form
("@herrkaschke") because that is all the remote HTML's visible text
carries once our reducer strips the anchor around it - the host lives
only in that anchor and in the object's Mention tags. The renderer
deliberately leaves a bare @name in remote content unlinked (it would
point at whatever vutuv member shares the handle), so mentioned
accounts sat on the card as dead text.
Vutuv.RemoteHtml.to_text/3 now takes those Mention tags and widens each
short form to the full @user@host, which VutuvWeb.Markdown already
links to the remote profile like any typed fediverse handle - no
renderer change, and the agent-format siblings carry the more precise
address for free. Every fediverse content path hands the tags along
(cached posts of followed accounts, inbound replies, the Update and
refresh paths), and the Mastodon profile feed normalizes its REST
mentions array to the same shape.
Deliberate limits: an expansion only happens when it is unambiguous
(two mentioned accounts sharing one short name stay plain - never guess
which the author meant), when the result matches the shared entity
grammar (so a dotted Misskey name is not half-linked), and when the
host is not this very installation (the renderer would link straight
back at a page vutuv does not serve). Already-stored posts keep their
short forms; they age out via the retention ceiling.
An AI agent wrote this text in my name, unreviewed by me. The work
behind it is mine; I only delegated the writing.
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.
TL;DR A mention in a remote fediverse post (e.g.
@herrkaschkein a Mastodon post shown in the feed) is now stored as its full@user@hostaddress, which the renderer links to the account on its home server.Where:
Vutuv.RemoteHtml.to_text/3(the one remote-HTML reducer), the content call sites inVutuv.Fediverse(cached posts, inbound replies, Update/refresh paths) andVutuv.Mastodon(profile feed, RESTmentionsnormalized to the AP Mention-tag shape).Now: the remote HTML renders a mention as the bare
@user; the strip loses the anchor that carried the host, andrender_remotedeliberately leaves a bare@nameunlinked — so mentioned accounts were dead text.Want: the reducer widens
@userto@user@hostfrom the object'sMentiontags;VutuvWeb.Markdownalready links that form tohttps://host/@user— no renderer change.Guards: expansion only when unambiguous (two accounts sharing one short name stay plain), only when the result matches the shared entity grammar, never for this installation's own host; tag count capped against hostile deliveries; the clamp still bounds the stored text. Already-stored posts keep their short forms and age out via retention.
Deploy: hot (no migrations, no config/supervision/deps changes). Version bump to 7.207.0 (minor, user-facing feature).
An AI agent wrote this text in my name, unreviewed by me. The work behind it is mine; I only delegated the writing.