mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-30 15:34:02 +01:00
Ensure the serial returned by presence is always an integer
This commit is contained in:
parent
9fbcf19188
commit
d98edb548a
1 changed files with 3 additions and 3 deletions
|
@ -859,7 +859,7 @@ class PresenceEventSource(object):
|
|||
presence = self.hs.get_handlers().presence_handler
|
||||
cachemap = presence._user_cachemap
|
||||
clock = self.clock
|
||||
latest_serial = None
|
||||
latest_serial = 0
|
||||
|
||||
updates = []
|
||||
# TODO(paul): use a DeferredList ? How to limit concurrency.
|
||||
|
@ -872,8 +872,7 @@ class PresenceEventSource(object):
|
|||
if not (yield self.is_visible(observer_user, observed_user)):
|
||||
continue
|
||||
|
||||
if latest_serial is None or cached.serial > latest_serial:
|
||||
latest_serial = cached.serial
|
||||
latest_serial = max(cached.serial, latest_serial)
|
||||
updates.append(cached.make_event(user=observed_user, clock=clock))
|
||||
|
||||
# TODO(paul): limit
|
||||
|
@ -882,6 +881,7 @@ class PresenceEventSource(object):
|
|||
if serial < from_key:
|
||||
break
|
||||
|
||||
latest_serial = max(cached.serial, serial)
|
||||
for u in user_ids:
|
||||
updates.append({
|
||||
"type": "m.presence",
|
||||
|
|
Loading…
Reference in a new issue