Repository navigation
feat: bridge incoming imessage formatting and mentions; fix unnamed new dms - #11
Merged
Merged
Conversation
added 3 commits
November 27, 2026 16:58
rustpush renders a message with formatting or mentions to HTML (WrappedMessage.html, mentions as <a href="tel:...">@name</a>), but the connector never read it, so every inbound message reached Matrix as plain text with an empty m.mentions and clients showed "@name" with no pill. Single-part text messages now carry that HTML as formatted_body, with each mention rewritten to a matrix.to link for the mentioned ghost, or for the user's own Matrix account when one of their handles is mentioned, and listed in m.mentions. Messages split across several events stay plain.
A DM room created by the first message from a new contact stayed unnamed. bridgev2 v0.28 pushes a newly named ghost's name and avatar to its DM rooms in a goroutine that keeps the caller's context, which during room creation is cancelled as soon as creation returns; the m.room.name send failed with "context canceled" and updateName only retries when the ghost changes again. Clients then showed the member list, bot included, as a group-looking room. The periodic DM title refresh now also treats a DM whose name or avatar was chosen but not sent as broken and queues a ChatInfoChange, whose UpdateInfo ends in UpdateInfoFromGhost and resends both.
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.
rustpush already renders a message's formatting and mentions to HTML (WrappedMessage.html), but the connector never read it, so incoming messages reached Matrix as plain text with an empty m.mentions. Single-part text now carries that HTML as formatted_body, each mention rewritten to a matrix.to link for the mentioned ghost (or the user's own account for their handles) and listed in m.mentions.
The second commit fixes a new contact's DM room staying unnamed. bridgev2 v0.28 pushes a newly named ghost's name to its DM rooms in a goroutine that keeps the room-creation context, which is cancelled when creation returns, so m.room.name fails with "context canceled" and isn't retried. The periodic DM title refresh now picks up a DM whose name or avatar was chosen but never sent.
Test plan
go test ./pkg/connector/ -run 'TestRewriteMention|TestDMRoomMetaUnsent'