summary refs log tree commit diff
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-05-21 15:23:40 +0100
committerMark Haines <mark.haines@matrix.org>2015-05-21 15:23:58 +0100
commit88f1ea36cedff158e7a595c84bf949286fa38532 (patch)
tree1d30c573dafbea1d325c4b7116afa352180a0b68
parentMerge pull request #155 from matrix-org/erikj/perf (diff)
downloadsynapse-88f1ea36cedff158e7a595c84bf949286fa38532.tar.xz
Oops, get_rooms_for_user returns a namedtuple, not a room_id
-rw-r--r--synapse/notifier.py1
-rw-r--r--tests/rest/client/v1/test_presence.py7
2 files changed, 7 insertions, 1 deletions
diff --git a/synapse/notifier.py b/synapse/notifier.py
index 1e73d52c4d..4f47f88df8 100644
--- a/synapse/notifier.py
+++ b/synapse/notifier.py
@@ -296,6 +296,7 @@ class Notifier(object):
             appservice = yield self.store.get_app_service_by_user_id(user)
             current_token = yield self.event_sources.get_current_token()
             rooms = yield self.store.get_rooms_for_user(user)
+            rooms = [room.room_id for room in rooms]
             user_stream = _NotifierUserStream(
                 user=user,
                 rooms=rooms,
diff --git a/tests/rest/client/v1/test_presence.py b/tests/rest/client/v1/test_presence.py
index 29c0038f06..21f42b3d3e 100644
--- a/tests/rest/client/v1/test_presence.py
+++ b/tests/rest/client/v1/test_presence.py
@@ -29,6 +29,8 @@ from synapse.rest.client.v1 import events
 from synapse.types import UserID
 from synapse.util.async import run_on_reactor
 
+from collections import namedtuple
+
 
 OFFLINE = PresenceState.OFFLINE
 UNAVAILABLE = PresenceState.UNAVAILABLE
@@ -302,7 +304,10 @@ class PresenceEventStreamTestCase(unittest.TestCase):
             return_value=defer.succeed(None)
         )
         self.mock_datastore.get_rooms_for_user = (
-            lambda u: get_rooms_for_user(UserID.from_string(u))
+            lambda u: [
+                namedtuple("Room", "room_id")(r)
+                for r in get_rooms_for_user(UserID.from_string(u))
+            ]
         )
 
         def get_profile_displayname(user_id):