mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
Include room membership in room initialSync
This commit is contained in:
parent
1fd8139138
commit
c23afed39a
@ -336,11 +336,17 @@ class MessageHandler(BaseHandler):
|
|||||||
feedback=False):
|
feedback=False):
|
||||||
yield self.auth.check_joined_room(room_id, user_id)
|
yield self.auth.check_joined_room(room_id, user_id)
|
||||||
|
|
||||||
|
# TODO: These concurrently
|
||||||
state_tuples = yield self.store.get_current_state(room_id)
|
state_tuples = yield self.store.get_current_state(room_id)
|
||||||
state = [self.hs.serialize_event(x) for x in state_tuples]
|
state = [self.hs.serialize_event(x) for x in state_tuples]
|
||||||
|
|
||||||
|
member_event = (yield self.store.get_room_member(
|
||||||
|
user_id=user_id,
|
||||||
|
room_id=room_id
|
||||||
|
))
|
||||||
|
|
||||||
defer.returnValue({
|
defer.returnValue({
|
||||||
#"membership": membership,
|
"membership": member_event.membership,
|
||||||
"room_id": room_id,
|
"room_id": room_id,
|
||||||
#"messages": messages,
|
#"messages": messages,
|
||||||
"state": state,
|
"state": state,
|
||||||
|
@ -1017,6 +1017,7 @@ class RoomInitialSyncTestCase(RestTestCase):
|
|||||||
self.assertEquals(200, code)
|
self.assertEquals(200, code)
|
||||||
|
|
||||||
self.assertEquals(self.room_id, response["room_id"])
|
self.assertEquals(self.room_id, response["room_id"])
|
||||||
|
self.assertEquals("join", response["membership"])
|
||||||
|
|
||||||
# Room state is easier to assert on if we unpack it into a dict
|
# Room state is easier to assert on if we unpack it into a dict
|
||||||
state = {}
|
state = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user