From 02f4e3b3ff613a6e9024c0fef416be0bf92bf48f Mon Sep 17 00:00:00 2001 From: "Paul \"LeoNerd\" Evans" Date: Mon, 1 Sep 2014 14:45:35 +0100 Subject: Rename 'state' presence key to the much more obvious 'presence'; maintain a legacy 'state' copy for now --- tests/handlers/test_presence.py | 122 ++++++++++++++++++++++++++-------------- 1 file changed, 79 insertions(+), 43 deletions(-) (limited to 'tests/handlers/test_presence.py') diff --git a/tests/handlers/test_presence.py b/tests/handlers/test_presence.py index 451e1eaa22..f37d9917fe 100644 --- a/tests/handlers/test_presence.py +++ b/tests/handlers/test_presence.py @@ -35,8 +35,6 @@ ONLINE = PresenceState.ONLINE logging.getLogger().addHandler(logging.NullHandler()) -#logging.getLogger().addHandler(logging.StreamHandler()) -#logging.getLogger().setLevel(logging.DEBUG) def _expect_edu(destination, edu_type, content, origin="test"): @@ -141,7 +139,8 @@ class PresenceStateTestCase(unittest.TestCase): target_user=self.u_apple, auth_user=self.u_apple ) - self.assertEquals({"state": ONLINE, "status_msg": "Online"}, + self.assertEquals( + {"state": ONLINE, "presence": ONLINE, "status_msg": "Online"}, state ) mocked_get.assert_called_with("apple") @@ -157,7 +156,8 @@ class PresenceStateTestCase(unittest.TestCase): target_user=self.u_apple, auth_user=self.u_banana ) - self.assertEquals({"state": ONLINE, "status_msg": "Online"}, + self.assertEquals( + {"state": ONLINE, "presence": ONLINE, "status_msg": "Online"}, state ) mocked_get.assert_called_with("apple") @@ -175,7 +175,10 @@ class PresenceStateTestCase(unittest.TestCase): target_user=self.u_apple, auth_user=self.u_clementine ) - self.assertEquals({"state": ONLINE, "status_msg": "Online"}, state) + self.assertEquals( + {"state": ONLINE, "presence": ONLINE, "status_msg": "Online"}, + state + ) @defer.inlineCallbacks def test_get_disallowed_state(self): @@ -202,20 +205,20 @@ class PresenceStateTestCase(unittest.TestCase): yield self.handler.set_state( target_user=self.u_apple, auth_user=self.u_apple, - state={"state": UNAVAILABLE, "status_msg": "Away"}) + state={"presence": UNAVAILABLE, "status_msg": "Away"}) mocked_set.assert_called_with("apple", {"state": UNAVAILABLE, "status_msg": "Away"}) self.mock_start.assert_called_with(self.u_apple, state={ - "state": UNAVAILABLE, + "presence": UNAVAILABLE, "status_msg": "Away", "mtime": 1000000, # MockClock }) yield self.handler.set_state( target_user=self.u_apple, auth_user=self.u_apple, - state={"state": OFFLINE}) + state={"presence": OFFLINE}) self.mock_stop.assert_called_with(self.u_apple) @@ -449,28 +452,35 @@ class PresenceInvitesTestCase(unittest.TestCase): @defer.inlineCallbacks def test_get_presence_list(self): self.datastore.get_presence_list.return_value = defer.succeed( - [{"observed_user_id": "@banana:test"}] + [{"observed_user_id": "@banana:test"}] ) presence = yield self.handler.get_presence_list( observer_user=self.u_apple) - self.assertEquals([{"observed_user": self.u_banana, - "state": OFFLINE}], presence) + self.assertEquals([ + {"observed_user": self.u_banana, + "presence": OFFLINE, + "state": OFFLINE}, + ], presence) self.datastore.get_presence_list.assert_called_with("apple", - accepted=None) - + accepted=None + ) self.datastore.get_presence_list.return_value = defer.succeed( - [{"observed_user_id": "@banana:test"}] + [{"observed_user_id": "@banana:test"}] ) presence = yield self.handler.get_presence_list( - observer_user=self.u_apple, accepted=True) + observer_user=self.u_apple, accepted=True + ) - self.assertEquals([{"observed_user": self.u_banana, - "state": OFFLINE}], presence) + self.assertEquals([ + {"observed_user": self.u_banana, + "presence": OFFLINE, + "state": OFFLINE}, + ], presence) self.datastore.get_presence_list.assert_called_with("apple", accepted=True) @@ -618,7 +628,8 @@ class PresencePushTestCase(unittest.TestCase): self.assertEquals(self.event_source.get_current_key(), 0) yield self.handler.set_state(self.u_apple, self.u_apple, - {"state": ONLINE}) + {"presence": ONLINE} + ) self.assertEquals(self.event_source.get_current_key(), 1) self.assertEquals( @@ -627,6 +638,7 @@ class PresencePushTestCase(unittest.TestCase): {"type": "m.presence", "content": { "user_id": "@apple:test", + "presence": ONLINE, "state": ONLINE, "mtime_age": 0, }}, @@ -636,13 +648,21 @@ class PresencePushTestCase(unittest.TestCase): presence = yield self.handler.get_presence_list( observer_user=self.u_apple, accepted=True) - self.assertEquals([ - {"observed_user": self.u_banana, "state": OFFLINE}, - {"observed_user": self.u_clementine, "state": OFFLINE}], - presence) + self.assertEquals( + [ + {"observed_user": self.u_banana, + "presence": OFFLINE, + "state": OFFLINE}, + {"observed_user": self.u_clementine, + "presence": OFFLINE, + "state": OFFLINE}, + ], + presence + ) yield self.handler.set_state(self.u_banana, self.u_banana, - {"state": ONLINE}) + {"presence": ONLINE} + ) self.clock.advance_time(2) @@ -651,9 +671,11 @@ class PresencePushTestCase(unittest.TestCase): self.assertEquals([ {"observed_user": self.u_banana, + "presence": ONLINE, "state": ONLINE, "mtime_age": 2000}, {"observed_user": self.u_clementine, + "presence": OFFLINE, "state": OFFLINE}, ], presence) @@ -666,6 +688,7 @@ class PresencePushTestCase(unittest.TestCase): {"type": "m.presence", "content": { "user_id": "@banana:test", + "presence": ONLINE, "state": ONLINE, "mtime_age": 2000 }}, @@ -682,6 +705,7 @@ class PresencePushTestCase(unittest.TestCase): content={ "push": [ {"user_id": "@apple:test", + "presence": u"online", "state": u"online", "mtime_age": 0}, ], @@ -703,7 +727,7 @@ class PresencePushTestCase(unittest.TestCase): apple_set.add(self.u_potato.domain) yield self.handler.set_state(self.u_apple, self.u_apple, - {"state": ONLINE} + {"presence": ONLINE} ) yield put_json.await_calls() @@ -741,6 +765,7 @@ class PresencePushTestCase(unittest.TestCase): {"type": "m.presence", "content": { "user_id": "@potato:remote", + "presence": ONLINE, "state": ONLINE, "mtime_age": 1000, }} @@ -751,7 +776,10 @@ class PresencePushTestCase(unittest.TestCase): state = yield self.handler.get_state(self.u_potato, self.u_apple) - self.assertEquals({"state": ONLINE, "mtime_age": 3000}, state) + self.assertEquals( + {"state": ONLINE, "presence": ONLINE, "mtime_age": 3000}, + state + ) @defer.inlineCallbacks def test_join_room_local(self): @@ -763,7 +791,7 @@ class PresencePushTestCase(unittest.TestCase): self.handler._user_cachemap[self.u_clementine] = UserPresenceCache() self.handler._user_cachemap[self.u_clementine].update( { - "state": PresenceState.ONLINE, + "presence": PresenceState.ONLINE, "mtime": self.clock.time_msec(), }, self.u_clementine ) @@ -781,6 +809,7 @@ class PresencePushTestCase(unittest.TestCase): {"type": "m.presence", "content": { "user_id": "@clementine:test", + "presence": ONLINE, "state": ONLINE, "mtime_age": 0, }} @@ -798,7 +827,8 @@ class PresencePushTestCase(unittest.TestCase): content={ "push": [ {"user_id": "@apple:test", - "state": "online"}, + "presence": "online", + "state": "online"}, ], } ), @@ -812,7 +842,8 @@ class PresencePushTestCase(unittest.TestCase): content={ "push": [ {"user_id": "@banana:test", - "state": "offline"}, + "presence": "offline", + "state": "offline"}, ], } ), @@ -823,7 +854,7 @@ class PresencePushTestCase(unittest.TestCase): # TODO(paul): Gut-wrenching self.handler._user_cachemap[self.u_apple] = UserPresenceCache() self.handler._user_cachemap[self.u_apple].update( - {"state": PresenceState.ONLINE}, self.u_apple) + {"presence": PresenceState.ONLINE}, self.u_apple) self.room_members = [self.u_apple, self.u_banana] yield self.distributor.fire("user_joined_room", self.u_potato, @@ -841,7 +872,8 @@ class PresencePushTestCase(unittest.TestCase): content={ "push": [ {"user_id": "@clementine:test", - "state": "online"}, + "presence": "online", + "state": "online"}, ], } ), @@ -851,7 +883,7 @@ class PresencePushTestCase(unittest.TestCase): self.handler._user_cachemap[self.u_clementine] = UserPresenceCache() self.handler._user_cachemap[self.u_clementine].update( - {"state": ONLINE}, self.u_clementine) + {"presence": ONLINE}, self.u_clementine) self.room_members.append(self.u_potato) yield self.distributor.fire("user_joined_room", self.u_clementine, @@ -969,7 +1001,7 @@ class PresencePollingTestCase(unittest.TestCase): # apple goes online yield self.handler.set_state( target_user=self.u_apple, auth_user=self.u_apple, - state={"state": ONLINE} + state={"presence": ONLINE} ) # apple should see both banana and clementine currently offline @@ -992,8 +1024,9 @@ class PresencePollingTestCase(unittest.TestCase): # banana goes online yield self.handler.set_state( - target_user=self.u_banana, auth_user=self.u_banana, - state={"state": ONLINE}) + target_user=self.u_banana, auth_user=self.u_banana, + state={"presence": ONLINE} + ) # apple and banana should now both see each other online self.mock_update_client.assert_has_calls([ @@ -1013,8 +1046,9 @@ class PresencePollingTestCase(unittest.TestCase): # apple goes offline yield self.handler.set_state( - target_user=self.u_apple, auth_user=self.u_apple, - state={"state": OFFLINE}) + target_user=self.u_apple, auth_user=self.u_apple, + state={"presence": OFFLINE} + ) # banana should now be told apple is offline self.mock_update_client.assert_has_calls([ @@ -1027,7 +1061,6 @@ class PresencePollingTestCase(unittest.TestCase): self.assertFalse("banana" in self.handler._local_pushmap) self.assertFalse("clementine" in self.handler._local_pushmap) - @defer.inlineCallbacks def test_remote_poll_send(self): put_json = self.mock_http_client.put_json @@ -1057,8 +1090,9 @@ class PresencePollingTestCase(unittest.TestCase): # clementine goes online yield self.handler.set_state( - target_user=self.u_clementine, auth_user=self.u_clementine, - state={"state": ONLINE}) + target_user=self.u_clementine, auth_user=self.u_clementine, + state={"presence": ONLINE} + ) yield put_json.await_calls() @@ -1085,7 +1119,7 @@ class PresencePollingTestCase(unittest.TestCase): # fig goes online; shouldn't send a second poll yield self.handler.set_state( target_user=self.u_fig, auth_user=self.u_fig, - state={"state": ONLINE} + state={"presence": ONLINE} ) # reactor.iterate(delay=0) @@ -1095,7 +1129,7 @@ class PresencePollingTestCase(unittest.TestCase): # fig goes offline yield self.handler.set_state( target_user=self.u_fig, auth_user=self.u_fig, - state={"state": OFFLINE} + state={"presence": OFFLINE} ) reactor.iterate(delay=0) @@ -1116,8 +1150,9 @@ class PresencePollingTestCase(unittest.TestCase): # clementine goes offline yield self.handler.set_state( - target_user=self.u_clementine, auth_user=self.u_clementine, - state={"state": OFFLINE}) + target_user=self.u_clementine, auth_user=self.u_clementine, + state={"presence": OFFLINE} + ) yield put_json.await_calls() @@ -1135,6 +1170,7 @@ class PresencePollingTestCase(unittest.TestCase): content={ "push": [ {"user_id": "@banana:test", + "presence": "offline", "state": "offline", "status_msg": None}, ], -- cgit 1.4.1 From 468d94c92066ddb76db7f38771e283c152cabb7d Mon Sep 17 00:00:00 2001 From: "Paul \"LeoNerd\" Evans" Date: Mon, 1 Sep 2014 15:38:37 +0100 Subject: Rename API-visible 'mtime' presence field to 'last_active'; slightly different semantics --- synapse/handlers/presence.py | 72 +++++++++++++++++++++++++------------ tests/handlers/test_presence.py | 29 +++++++++------ tests/handlers/test_presencelike.py | 20 +++++++---- tests/rest/test_presence.py | 2 +- 4 files changed, 82 insertions(+), 41 deletions(-) (limited to 'tests/handlers/test_presence.py') diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py index fa5942ba05..c1af07133f 100644 --- a/synapse/handlers/presence.py +++ b/synapse/handlers/presence.py @@ -52,6 +52,13 @@ def partitionbool(l, func): class PresenceHandler(BaseHandler): + STATE_LEVELS = { + PresenceState.OFFLINE: 0, + PresenceState.UNAVAILABLE: 1, + PresenceState.ONLINE: 2, + PresenceState.FREE_FOR_CHAT: 3, + } + def __init__(self, hs): super(PresenceHandler, self).__init__(hs) @@ -173,20 +180,24 @@ class PresenceHandler(BaseHandler): observed_user=target_user ) - if visible: - state = yield self.store.get_presence_state( - target_user.localpart - ) - state["presence"] = state["state"] - else: + if not visible: raise SynapseError(404, "Presence information not visible") + state = yield self.store.get_presence_state(target_user.localpart) + if "mtime" in state: + del state["mtime"] + state["presence"] = state["state"] + + if target_user in self._user_cachemap: + state["last_active"] = ( + self._user_cachemap[target_user].get_state()["last_active"] + ) else: # TODO(paul): Have remote server send us permissions set state = self._get_or_offline_usercache(target_user).get_state() - if "mtime" in state and (state["mtime"] is not None): - state["mtime_age"] = int( - self.clock.time_msec() - state.pop("mtime") + if "last_active" in state: + state["last_active_ago"] = int( + self.clock.time_msec() - state.pop("last_active") ) defer.returnValue(state) @@ -203,7 +214,6 @@ class PresenceHandler(BaseHandler): if target_user != auth_user: raise AuthError(400, "Cannot set another user's displayname") - # TODO(paul): Sanity-check 'state' if "status_msg" not in state: state["status_msg"] = None @@ -217,12 +227,21 @@ class PresenceHandler(BaseHandler): if "state" in state: state["presence"] = state.pop("state") + if state["presence"] not in self.STATE_LEVELS: + raise SynapseError(400, "'%s' is not a valid presence state" % + state["presence"] + ) + logger.debug("Updating presence state of %s to %s", target_user.localpart, state["presence"]) state_to_store = dict(state) state_to_store["state"] = state_to_store.pop("presence") + statuscache=self._get_or_offline_usercache(target_user) + was_level = self.STATE_LEVELS[statuscache.get_state()["presence"]] + now_level = self.STATE_LEVELS[state["presence"]] + yield defer.DeferredList([ self.store.set_presence_state( target_user.localpart, state_to_store @@ -232,7 +251,8 @@ class PresenceHandler(BaseHandler): ), ]) - state["mtime"] = self.clock.time_msec() + if now_level > was_level: + state["last_active"] = self.clock.time_msec() now_online = state["presence"] != PresenceState.OFFLINE was_polling = target_user in self._user_cachemap @@ -391,9 +411,9 @@ class PresenceHandler(BaseHandler): observed_user = self.hs.parse_userid(p.pop("observed_user_id")) p["observed_user"] = observed_user p.update(self._get_or_offline_usercache(observed_user).get_state()) - if "mtime" in p: - p["mtime_age"] = int( - self.clock.time_msec() - p.pop("mtime") + if "last_active" in p: + p["last_active_ago"] = int( + self.clock.time_msec() - p.pop("last_active") ) defer.returnValue(presence) @@ -582,16 +602,22 @@ class PresenceHandler(BaseHandler): def _push_presence_remote(self, user, destination, state=None): if state is None: state = yield self.store.get_presence_state(user.localpart) + del state["mtime"] state["presence"] = state["state"] + if user in self._user_cachemap: + state["last_active"] = ( + self._user_cachemap[user].get_state()["last_active"] + ) + yield self.distributor.fire( "collect_presencelike_data", user, state ) - if "mtime" in state: + if "last_active" in state: state = dict(state) - state["mtime_age"] = int( - self.clock.time_msec() - state.pop("mtime") + state["last_active_ago"] = int( + self.clock.time_msec() - state.pop("last_active") ) user_state = { @@ -636,9 +662,9 @@ class PresenceHandler(BaseHandler): state["presence"] = state["state"] del state["state"] - if "mtime_age" in state: - state["mtime"] = int( - self.clock.time_msec() - state.pop("mtime_age") + if "last_active_ago" in state: + state["last_active"] = int( + self.clock.time_msec() - state.pop("last_active_ago") ) statuscache = self._get_or_make_usercache(user) @@ -846,9 +872,9 @@ class UserPresenceCache(object): content = self.get_state() content["user_id"] = user.to_string() - if "mtime" in content: - content["mtime_age"] = int( - clock.time_msec() - content.pop("mtime") + if "last_active" in content: + content["last_active_ago"] = int( + clock.time_msec() - content.pop("last_active") ) return {"type": "m.presence", "content": content} diff --git a/tests/handlers/test_presence.py b/tests/handlers/test_presence.py index f37d9917fe..844c4e3fb7 100644 --- a/tests/handlers/test_presence.py +++ b/tests/handlers/test_presence.py @@ -213,7 +213,7 @@ class PresenceStateTestCase(unittest.TestCase): state={ "presence": UNAVAILABLE, "status_msg": "Away", - "mtime": 1000000, # MockClock + "last_active": 1000000, # MockClock }) yield self.handler.set_state( @@ -621,6 +621,9 @@ class PresencePushTestCase(unittest.TestCase): # TODO(paul): Gut-wrenching self.handler._user_cachemap[self.u_apple] = UserPresenceCache() + self.handler._user_cachemap[self.u_apple].update( + {"presence": OFFLINE}, serial=0 + ) apple_set = self.handler._local_pushmap.setdefault("apple", set()) apple_set.add(self.u_banana) apple_set.add(self.u_clementine) @@ -640,7 +643,7 @@ class PresencePushTestCase(unittest.TestCase): "user_id": "@apple:test", "presence": ONLINE, "state": ONLINE, - "mtime_age": 0, + "last_active_ago": 0, }}, ], ) @@ -673,7 +676,7 @@ class PresencePushTestCase(unittest.TestCase): {"observed_user": self.u_banana, "presence": ONLINE, "state": ONLINE, - "mtime_age": 2000}, + "last_active_ago": 2000}, {"observed_user": self.u_clementine, "presence": OFFLINE, "state": OFFLINE}, @@ -690,7 +693,7 @@ class PresencePushTestCase(unittest.TestCase): "user_id": "@banana:test", "presence": ONLINE, "state": ONLINE, - "mtime_age": 2000 + "last_active_ago": 2000 }}, ] ) @@ -707,7 +710,7 @@ class PresencePushTestCase(unittest.TestCase): {"user_id": "@apple:test", "presence": u"online", "state": u"online", - "mtime_age": 0}, + "last_active_ago": 0}, ], } ) @@ -723,6 +726,9 @@ class PresencePushTestCase(unittest.TestCase): # TODO(paul): Gut-wrenching self.handler._user_cachemap[self.u_apple] = UserPresenceCache() + self.handler._user_cachemap[self.u_apple].update( + {"presence": OFFLINE}, serial=0 + ) apple_set = self.handler._remote_sendmap.setdefault("apple", set()) apple_set.add(self.u_potato.domain) @@ -750,7 +756,7 @@ class PresencePushTestCase(unittest.TestCase): "push": [ {"user_id": "@potato:remote", "state": "online", - "mtime_age": 1000}, + "last_active_ago": 1000}, ], } ) @@ -767,7 +773,7 @@ class PresencePushTestCase(unittest.TestCase): "user_id": "@potato:remote", "presence": ONLINE, "state": ONLINE, - "mtime_age": 1000, + "last_active_ago": 1000, }} ] ) @@ -777,7 +783,7 @@ class PresencePushTestCase(unittest.TestCase): state = yield self.handler.get_state(self.u_potato, self.u_apple) self.assertEquals( - {"state": ONLINE, "presence": ONLINE, "mtime_age": 3000}, + {"state": ONLINE, "presence": ONLINE, "last_active_ago": 3000}, state ) @@ -792,7 +798,7 @@ class PresencePushTestCase(unittest.TestCase): self.handler._user_cachemap[self.u_clementine].update( { "presence": PresenceState.ONLINE, - "mtime": self.clock.time_msec(), + "last_active": self.clock.time_msec(), }, self.u_clementine ) @@ -811,7 +817,7 @@ class PresencePushTestCase(unittest.TestCase): "user_id": "@clementine:test", "presence": ONLINE, "state": ONLINE, - "mtime_age": 0, + "last_active_ago": 0, }} ] ) @@ -967,7 +973,8 @@ class PresencePollingTestCase(unittest.TestCase): def get_presence_state(user_localpart): return defer.succeed( {"state": self.current_user_state[user_localpart], - "status_msg": None} + "status_msg": None, + "mtime": 123456000} ) self.datastore.get_presence_state = get_presence_state diff --git a/tests/handlers/test_presencelike.py b/tests/handlers/test_presencelike.py index 2402bed8d5..38cc34350b 100644 --- a/tests/handlers/test_presencelike.py +++ b/tests/handlers/test_presencelike.py @@ -166,7 +166,11 @@ class PresenceProfilelikeDataTestCase(unittest.TestCase): # TODO(paul): Gut-wrenching from synapse.handlers.presence import UserPresenceCache self.handlers.presence_handler._user_cachemap[self.u_apple] = ( - UserPresenceCache()) + UserPresenceCache() + ) + self.handlers.presence_handler._user_cachemap[self.u_apple].update( + {"presence": OFFLINE}, serial=0 + ) apple_set = self.handlers.presence_handler._local_pushmap.setdefault( "apple", set()) apple_set.add(self.u_banana) @@ -184,7 +188,7 @@ class PresenceProfilelikeDataTestCase(unittest.TestCase): {"observed_user": self.u_banana, "presence": ONLINE, "state": ONLINE, - "mtime_age": 0, + "last_active_ago": 0, "displayname": "Frank", "avatar_url": "http://foo"}, {"observed_user": self.u_clementine, @@ -202,7 +206,7 @@ class PresenceProfilelikeDataTestCase(unittest.TestCase): statuscache = self.mock_update_client.call_args[1]["statuscache"] self.assertEquals({ "presence": ONLINE, - "mtime": 1000000, # MockClock + "last_active": 1000000, # MockClock "displayname": "Frank", "avatar_url": "http://foo", }, statuscache.state) @@ -225,7 +229,7 @@ class PresenceProfilelikeDataTestCase(unittest.TestCase): statuscache = self.mock_update_client.call_args[1]["statuscache"] self.assertEquals({ "presence": ONLINE, - "mtime": 1000000, # MockClock + "last_active": 1000000, # MockClock "displayname": "I am an Apple", "avatar_url": "http://foo", }, statuscache.state) @@ -243,7 +247,11 @@ class PresenceProfilelikeDataTestCase(unittest.TestCase): # TODO(paul): Gut-wrenching from synapse.handlers.presence import UserPresenceCache self.handlers.presence_handler._user_cachemap[self.u_apple] = ( - UserPresenceCache()) + UserPresenceCache() + ) + self.handlers.presence_handler._user_cachemap[self.u_apple].update( + {"presence": OFFLINE}, serial=0 + ) apple_set = self.handlers.presence_handler._remote_sendmap.setdefault( "apple", set()) apple_set.add(self.u_potato.domain) @@ -259,7 +267,7 @@ class PresenceProfilelikeDataTestCase(unittest.TestCase): {"user_id": "@apple:test", "presence": "online", "state": "online", - "mtime_age": 0, + "last_active_ago": 0, "displayname": "Frank", "avatar_url": "http://foo"}, ], diff --git a/tests/rest/test_presence.py b/tests/rest/test_presence.py index f5afa4a256..e2cdd80e07 100644 --- a/tests/rest/test_presence.py +++ b/tests/rest/test_presence.py @@ -330,6 +330,6 @@ class PresenceEventStreamTestCase(unittest.TestCase): "presence": ONLINE, "state": ONLINE, "displayname": "Frank", - "mtime_age": 0, + "last_active_ago": 0, }}, ]}, response) -- cgit 1.4.1