Skip to content

Bridge Discord call state notices#229

Draft
Adri11334 wants to merge 1 commit into
mautrix:megadiscordfrom
Adri11334:private-call-state-notices
Draft

Bridge Discord call state notices#229
Adri11334 wants to merge 1 commit into
mautrix:megadiscordfrom
Adri11334:private-call-state-notices

Conversation

@Adri11334

@Adri11334 Adri11334 commented Jun 15, 2026

Copy link
Copy Markdown

Depends on

This uses discordgo.Message.Call, so the bridge PR should stay draft until the dependency lands and the module can be bumped normally.

Summary

Keeps Discord private call notices up to date using call message metadata and voice state events.

Changes

  • render active call notices from message.call.participants
  • render ended call notices from message.call.ended_timestamp, including short human-readable durations
  • preserve call context across partial MESSAGE_UPDATE payloads
  • track active private calls in memory and edit the Matrix notice on VOICE_STATE_UPDATE join/leave events
  • keep 1:1 DM notices focused on whether the current user is in the call, while group DMs show participant counts

Expected behavior

1:1 DMs:

  • incoming active call while not joined: (caller started a call. Use the Discord app to answer.)
  • current user joins: (You are in a call with caller. Use the Discord app to manage the call.)
  • current user leaves before the call ends: the notice edits back to the incoming active call text
  • call ends: (caller started a call that lasted 9s.)

Group DMs:

  • active call with two participants, current user not joined: (caller started a call. 2 people are in the call. Use the Discord app to join.)
  • current user joins: (caller started a call. 3 people are in the call. Use the Discord app to manage the call.)
  • participants join/leave: the participant count updates from voice state events
  • call ends: (caller started a call that lasted 2m 3s.)

Testing

  • go test ./pkg/msgconv ./pkg/connector -run 'TestRenderDiscordCallMessage|TestFormatDiscordCallDuration|TestFillMissingMessageUpdateFieldsPreservesCallContext|TestDiscordCallState' -count=1
  • go test ./... -run '^$'
  • pre-commit run --all-files
  • Manual Beeper smoke test with a local bridge: 1:1 call start/join/leave/end edits the notice as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant