mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 12:06:08 -04:00
Initialise UserPresenceCache instances to always contain a 'presence' key
This commit is contained in:
parent
4eada9a908
commit
03dc63f6c8
2 changed files with 10 additions and 6 deletions
|
@ -139,9 +139,7 @@ class PresenceHandler(BaseHandler):
|
|||
if user in self._user_cachemap:
|
||||
return self._user_cachemap[user]
|
||||
else:
|
||||
statuscache = UserPresenceCache()
|
||||
statuscache.update({"presence": PresenceState.OFFLINE}, user)
|
||||
return statuscache
|
||||
return UserPresenceCache()
|
||||
|
||||
def registered_user(self, user):
|
||||
self.store.create_presence(user.localpart)
|
||||
|
@ -873,7 +871,7 @@ class UserPresenceCache(object):
|
|||
Includes the update timestamp.
|
||||
"""
|
||||
def __init__(self):
|
||||
self.state = {}
|
||||
self.state = {"presence": PresenceState.OFFLINE}
|
||||
self.serial = None
|
||||
|
||||
def update(self, state, serial):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue