mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 07:54:48 -04:00
Implement MSC3026: busy presence state
This commit is contained in:
parent
7b06f85c0e
commit
405aeb0b2c
6 changed files with 27 additions and 1 deletions
|
@ -730,6 +730,7 @@ class PresenceHandler(BasePresenceHandler):
|
|||
PresenceState.ONLINE,
|
||||
PresenceState.UNAVAILABLE,
|
||||
PresenceState.OFFLINE,
|
||||
PresenceState.BUSY,
|
||||
)
|
||||
if presence not in valid_presence:
|
||||
raise SynapseError(400, "Invalid presence state")
|
||||
|
@ -744,7 +745,7 @@ class PresenceHandler(BasePresenceHandler):
|
|||
msg = status_msg if presence != PresenceState.OFFLINE else None
|
||||
new_fields["status_msg"] = msg
|
||||
|
||||
if presence == PresenceState.ONLINE:
|
||||
if presence == PresenceState.ONLINE or presence == PresenceState.BUSY:
|
||||
new_fields["last_active_ts"] = self.clock.time_msec()
|
||||
|
||||
await self._update_states([prev_state.copy_and_replace(**new_fields)])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue