feat(presence): add presence badges to the DM list and account switcher#608
Draft
Just-Insane wants to merge 2 commits intoSableClient:devfrom
Draft
feat(presence): add presence badges to the DM list and account switcher#608Just-Insane wants to merge 2 commits intoSableClient:devfrom
Just-Insane wants to merge 2 commits intoSableClient:devfrom
Conversation
…resence data - DirectDMsList: show PresenceBadge on DM avatar — actual presence for 1:1 DMs, green dot when any participant is online for group DMs - AccountSwitcherTab: show PresenceBadge on own account avatar in sidebar - Fix AvatarPresence placement: move wrapper outside SidebarAvatar (overflow:hidden was clipping the badge) - useUserPresence: reset presence state when userId changes; add REST fallback for sliding sync (Synapse MSC4186 has no presence extension so m.presence events are never delivered via sync — GET /presence/:userId/status bootstraps the initial state) - ClientNonUIFeatures: explicitly PUT /presence/:userId/status on visibility change so the server records online/offline state; setSyncPresence is a no-op on MSC4186
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.
Description
Adds visual presence indicators (online / busy / offline dot) to DM list entries in the sidebar and to the account switcher avatar.
Also fixes presence under sliding sync. Sliding sync (MSC4186) does not deliver
m.presenceevents, soUser.presencestays at the SDK default andgetLastActiveTs()stays 0 for all contacts. When no cached presence is available, the hook now falls back toGET /_matrix/client/v3/presence/{userId}/statusand updates the badge once the response arrives. If the server returns 404 (presence not enabled), the error is silently ignored and existing state is kept.Fixes #
Type of change
Checklist:
AI disclosure:
The REST presence fallback logic in
useUserPresenceand the badge rendering inDirectDMsList/AccountSwitcherTabwere partially AI assisted. I reviewed the sliding sync limitation, verified server error handling, and confirmed thecancelledflag guards the async fetch correctly on unmount.