diff options
author | Erik Johnston <erik@matrix.org> | 2014-08-18 11:14:57 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2014-08-18 11:14:57 +0100 |
commit | 1c2caacd67d5c00fe96c302749e30da3dc4a213f (patch) | |
tree | 4ce4c26aeef0ef31471ce238cbae91e7225bccb1 /synapse | |
parent | Change the MemoryDataStore to implement new storage api (diff) | |
parent | webclient: Tweak namespace of auto-complete directive. ng- should really only... (diff) | |
download | synapse-1c2caacd67d5c00fe96c302749e30da3dc4a213f.tar.xz |
Merge branch 'master' of github.com:matrix-org/synapse into sql_refactor
Diffstat (limited to 'synapse')
-rw-r--r-- | synapse/handlers/presence.py | 9 | ||||
-rw-r--r-- | synapse/storage/presence.py | 1 |
2 files changed, 8 insertions, 2 deletions
diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py index 049891eaf8..f0d7b34682 100644 --- a/synapse/handlers/presence.py +++ b/synapse/handlers/presence.py @@ -166,17 +166,22 @@ class PresenceHandler(BaseHandler): observed_user=target_user ) - if visible: + if visible or True: # XXX: FIXME: Bodge to unbreak matrix.org. breaks UTs. state = yield self.store.get_presence_state( target_user.localpart ) else: + # FIXME: *Surely* we shouldn't be 404ing the whole request, whatever + # it is, just because presence info isn't visible?! + # This causes client/api/v1/rooms/!cURbafjkfsMDVwdRDQ%3Amatrix.org/members/list + # to 404 currently + raise SynapseError(404, "Presence information not visible") else: # TODO(paul): Have remote server send us permissions set state = self._get_or_offline_usercache(target_user).get_state() - if "mtime" in state: + if "mtime" in state and (state["mtime"] is not None): state["mtime_age"] = int( self.clock.time_msec() - state.pop("mtime") ) diff --git a/synapse/storage/presence.py b/synapse/storage/presence.py index 23b6d1694e..a529104f4d 100644 --- a/synapse/storage/presence.py +++ b/synapse/storage/presence.py @@ -67,6 +67,7 @@ class PresenceStore(SQLBaseStore): table="presence_allow_inbound", keyvalues={"observed_user_id": observed_localpart, "observer_user_id": observer_userid}, + retcols=["observed_user_id"], allow_none=True, ) |