summary refs log tree commit diff
path: root/tests/handlers
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <paul@matrix.org>2015-04-23 19:01:37 +0100
committerPaul "LeoNerd" Evans <paul@matrix.org>2015-04-23 19:01:37 +0100
commite1e5e53127540fbaa4e23fbc628113983efd767b (patch)
tree47fe3729e246c192679ec1c6b5335472e22fab35 /tests/handlers
parentDon't let the remote offline serial list grow arbitrarily large (diff)
downloadsynapse-e1e5e53127540fbaa4e23fbc628113983efd767b.tar.xz
Remove users from the remote_offline_serials list (and clean up empty elements) when they go online again
Diffstat (limited to 'tests/handlers')
-rw-r--r--tests/handlers/test_presence.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/handlers/test_presence.py b/tests/handlers/test_presence.py
index bb497b6f09..9f5580c096 100644
--- a/tests/handlers/test_presence.py
+++ b/tests/handlers/test_presence.py
@@ -916,6 +916,33 @@ class PresencePushTestCase(MockedDatastorePresenceTestCase):
             ]
         )
 
+        yield self.mock_federation_resource.trigger("PUT",
+            "/_matrix/federation/v1/send/1000001/",
+            _make_edu_json("elsewhere", "m.presence",
+                content={
+                    "push": [
+                        {"user_id": "@potato:remote",
+                         "presence": "online"},
+                    ],
+                }
+            )
+        )
+
+        self.assertEquals(self.event_source.get_current_key(), 2)
+
+        (events, _) = yield self.event_source.get_new_events_for_user(
+            self.u_apple, 0, None
+        )
+        self.assertEquals(events,
+            [
+                {"type": "m.presence",
+                 "content": {
+                     "user_id": "@potato:remote",
+                     "presence": ONLINE,
+                }}
+            ]
+        )
+
     @defer.inlineCallbacks
     def test_join_room_local(self):
         self.room_members = [self.u_apple, self.u_banana]