mirror of
https://mau.dev/maunium/synapse.git
synced 2024-11-12 04:52:26 +01:00
Fix lint
This commit is contained in:
parent
066c703729
commit
0b56481caa
2 changed files with 10 additions and 11 deletions
|
@ -441,12 +441,12 @@ class GenericWorkerPresence(BasePresenceHandler):
|
||||||
PresenceState.ONLINE,
|
PresenceState.ONLINE,
|
||||||
PresenceState.UNAVAILABLE,
|
PresenceState.UNAVAILABLE,
|
||||||
PresenceState.OFFLINE,
|
PresenceState.OFFLINE,
|
||||||
|
PresenceState.BUSY,
|
||||||
)
|
)
|
||||||
|
|
||||||
if self._busy_presence_enabled:
|
if presence not in valid_presence or (
|
||||||
valid_presence += (PresenceState.BUSY,)
|
presence == PresenceState.BUSY and not self._busy_presence_enabled
|
||||||
|
):
|
||||||
if presence not in valid_presence:
|
|
||||||
raise SynapseError(400, "Invalid presence state")
|
raise SynapseError(400, "Invalid presence state")
|
||||||
|
|
||||||
user_id = target_user.to_string()
|
user_id = target_user.to_string()
|
||||||
|
|
|
@ -732,12 +732,12 @@ class PresenceHandler(BasePresenceHandler):
|
||||||
PresenceState.ONLINE,
|
PresenceState.ONLINE,
|
||||||
PresenceState.UNAVAILABLE,
|
PresenceState.UNAVAILABLE,
|
||||||
PresenceState.OFFLINE,
|
PresenceState.OFFLINE,
|
||||||
|
PresenceState.BUSY,
|
||||||
)
|
)
|
||||||
|
|
||||||
if self._busy_presence_enabled:
|
if presence not in valid_presence or (
|
||||||
valid_presence += (PresenceState.BUSY,)
|
presence == PresenceState.BUSY and not self._busy_presence_enabled
|
||||||
|
):
|
||||||
if presence not in valid_presence:
|
|
||||||
raise SynapseError(400, "Invalid presence state")
|
raise SynapseError(400, "Invalid presence state")
|
||||||
|
|
||||||
user_id = target_user.to_string()
|
user_id = target_user.to_string()
|
||||||
|
@ -750,9 +750,8 @@ class PresenceHandler(BasePresenceHandler):
|
||||||
msg = status_msg if presence != PresenceState.OFFLINE else None
|
msg = status_msg if presence != PresenceState.OFFLINE else None
|
||||||
new_fields["status_msg"] = msg
|
new_fields["status_msg"] = msg
|
||||||
|
|
||||||
if (
|
if presence == PresenceState.ONLINE or (
|
||||||
presence == PresenceState.ONLINE or
|
self._busy_presence_enabled and presence == PresenceState.BUSY
|
||||||
(self._busy_presence_enabled and presence == PresenceState.BUSY)
|
|
||||||
):
|
):
|
||||||
new_fields["last_active_ts"] = self.clock.time_msec()
|
new_fields["last_active_ts"] = self.clock.time_msec()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue