feat(bridge): Discord badge on bridged users and a header chip on bridged rooms #479

Merged
jared merged 1 commits from feat/discord-bridge-badge into lotus 2026-10-28 22:27:42 -04:00
Owner

Now that the mautrix-discord bridge is live (matrix #44), it's hard to tell who in a bridged room is actually on Discord. This adds:

  • Discord icon next to bridged users' names in the timeline header, the member list and the profile popout, with the tooltip "On Discord (bridged)". Bridged users are recognised by mautrix-discord's @discord_<snowflake>: user IDs. The bridge bot (@discordbot) and look-alikes such as @discord_fan or @discord-relay are not matched.
  • "Discord" chip in the room header for rooms with an m.bridge / uk.half-shot.bridge state event (protocol discordgo). Its tooltip names the channel and server ("Bridged to #general in Lotus Guild on Discord"), and clicking it opens the channel in Discord. The link is used only if it is http(s), because anyone with state power in the room controls that value.

Code:

  • utils/bridge.ts, with unit tests: ghost detection, m.bridge parsing, merging with the unstable copy, link sanitising.
  • hooks/useRoomBridges.ts: live updates on bridge state changes.
  • components/bridge/BridgeBadge.tsx: the Discord glyph from simple-icons, in Discord blurple.

Tested: against the local homeserver with a bridged room (real mautrix-discord m.bridge content) and a @discord_… member. All four placements render, the chip links to the channel, and there are no page errors. Unit tests: 1453 pass, 0 fail. Typecheck, eslint and prettier are clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5

Now that the mautrix-discord bridge is live (matrix #44), it's hard to tell who in a bridged room is actually on Discord. This adds: - **Discord icon next to bridged users' names** in the timeline header, the member list and the profile popout, with the tooltip "On Discord (bridged)". Bridged users are recognised by mautrix-discord's `@discord_<snowflake>:` user IDs. The bridge bot (`@discordbot`) and look-alikes such as `@discord_fan` or `@discord-relay` are not matched. - **"Discord" chip in the room header** for rooms with an `m.bridge` / `uk.half-shot.bridge` state event (protocol `discordgo`). Its tooltip names the channel and server ("Bridged to #general in Lotus Guild on Discord"), and clicking it opens the channel in Discord. The link is used only if it is http(s), because anyone with state power in the room controls that value. Code: - `utils/bridge.ts`, with unit tests: ghost detection, `m.bridge` parsing, merging with the unstable copy, link sanitising. - `hooks/useRoomBridges.ts`: live updates on bridge state changes. - `components/bridge/BridgeBadge.tsx`: the Discord glyph from simple-icons, in Discord blurple. **Tested:** against the local homeserver with a bridged room (real mautrix-discord `m.bridge` content) and a `@discord_…` member. All four placements render, the chip links to the channel, and there are no page errors. Unit tests: 1453 pass, 0 fail. Typecheck, eslint and prettier are clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared added 1 commit 2026-10-28 22:07:20 -04:00
feat(bridge): Discord badge on bridged users and a header chip on bridged rooms
CI / Build & Quality Checks (push) Skipped
CI / Secret scan (gitleaks) (push) Skipped
CI / Playwright smoke (e2e) (push) Skipped
CI / Secret scan (gitleaks) (pull_request) Successful in 10s
CI / Build & Quality Checks (pull_request) Successful in 2m44s
CI / Trigger Desktop Build (pull_request) Skipped
CI / Docker image build & smoke test (pull_request) Skipped
CI / Playwright smoke (e2e) (pull_request) Successful in 17m26s
3c33169297
People who come in from Discord through mautrix-discord now carry a
Discord icon next to their name in the timeline, member list and profile,
and a room bridged to a Discord channel shows a "Discord" chip in its
header that names the channel and server and opens it in Discord.

Ghosts are recognised by mautrix-discord's @discord_<snowflake> user IDs;
rooms by their m.bridge / uk.half-shot.bridge state (protocol discordgo).
Only http(s) channel links are made clickable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared scheduled this pull request to auto merge when all checks succeed 2026-10-28 22:07:28 -04:00
jared merged commit 43445db5cc into lotus 2026-10-28 22:27:42 -04:00
jared deleted branch feat/discord-bridge-badge 2026-10-28 22:27:42 -04:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#479