mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-14 18:53:53 +01:00
Oops, get_rooms_for_user returns a namedtuple, not a room_id
This commit is contained in:
parent
a551c5dad7
commit
88f1ea36ce
2 changed files with 7 additions and 1 deletions
|
@ -296,6 +296,7 @@ class Notifier(object):
|
||||||
appservice = yield self.store.get_app_service_by_user_id(user)
|
appservice = yield self.store.get_app_service_by_user_id(user)
|
||||||
current_token = yield self.event_sources.get_current_token()
|
current_token = yield self.event_sources.get_current_token()
|
||||||
rooms = yield self.store.get_rooms_for_user(user)
|
rooms = yield self.store.get_rooms_for_user(user)
|
||||||
|
rooms = [room.room_id for room in rooms]
|
||||||
user_stream = _NotifierUserStream(
|
user_stream = _NotifierUserStream(
|
||||||
user=user,
|
user=user,
|
||||||
rooms=rooms,
|
rooms=rooms,
|
||||||
|
|
|
@ -29,6 +29,8 @@ from synapse.rest.client.v1 import events
|
||||||
from synapse.types import UserID
|
from synapse.types import UserID
|
||||||
from synapse.util.async import run_on_reactor
|
from synapse.util.async import run_on_reactor
|
||||||
|
|
||||||
|
from collections import namedtuple
|
||||||
|
|
||||||
|
|
||||||
OFFLINE = PresenceState.OFFLINE
|
OFFLINE = PresenceState.OFFLINE
|
||||||
UNAVAILABLE = PresenceState.UNAVAILABLE
|
UNAVAILABLE = PresenceState.UNAVAILABLE
|
||||||
|
@ -302,7 +304,10 @@ class PresenceEventStreamTestCase(unittest.TestCase):
|
||||||
return_value=defer.succeed(None)
|
return_value=defer.succeed(None)
|
||||||
)
|
)
|
||||||
self.mock_datastore.get_rooms_for_user = (
|
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):
|
def get_profile_displayname(user_id):
|
||||||
|
|
Loading…
Reference in a new issue