mirror of
https://github.com/SableClient/Sable.git
synced 2026-11-21 01:21:18 -08:00
Register a custom MSC4186 presence extension with the SlidingSync object so that m.presence events delivered via extensions.presence.events are processed into the SDK's User model on every poll. Without this, the SlidingSync object only auto-registers ExtensionToDevice and ExtensionAccountData (via SlidingSyncSdk), so presence payloads from the server were silently discarded. Components using useUserPresence (Profile, MembersDrawer, UserRoomProfile, UserHero, Presence) would always show stale/default presence. The extension follows the same path as regular /sync: map raw events through client.getEventMapper(), call user.setPresenceEvent() to update User state and emit UserEvent.Presence, UserEvent.CurrentlyActive, UserEvent.LastPresenceTs, then emit ClientEvent.Event on the client.