mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-29 19:23:58 +01:00
Merge pull request #375 from matrix-org/daniel/guestroominitialsync
Clean up room initialSync for guest users
This commit is contained in:
commit
924d85a75e
1 changed files with 15 additions and 10 deletions
|
@ -588,8 +588,6 @@ class MessageHandler(BaseHandler):
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def get_presence():
|
def get_presence():
|
||||||
states = {}
|
|
||||||
if not is_guest:
|
|
||||||
states = yield presence_handler.get_states(
|
states = yield presence_handler.get_states(
|
||||||
target_users=[UserID.from_string(m.user_id) for m in room_members],
|
target_users=[UserID.from_string(m.user_id) for m in room_members],
|
||||||
auth_user=auth_user,
|
auth_user=auth_user,
|
||||||
|
@ -599,12 +597,19 @@ class MessageHandler(BaseHandler):
|
||||||
|
|
||||||
defer.returnValue(states.values())
|
defer.returnValue(states.values())
|
||||||
|
|
||||||
|
@defer.inlineCallbacks
|
||||||
|
def get_receipts():
|
||||||
receipts_handler = self.hs.get_handlers().receipts_handler
|
receipts_handler = self.hs.get_handlers().receipts_handler
|
||||||
|
receipts = yield receipts_handler.get_receipts_for_room(
|
||||||
|
room_id,
|
||||||
|
now_token.receipt_key
|
||||||
|
)
|
||||||
|
defer.returnValue(receipts)
|
||||||
|
|
||||||
presence, receipts, (messages, token) = yield defer.gatherResults(
|
presence, receipts, (messages, token) = yield defer.gatherResults(
|
||||||
[
|
[
|
||||||
get_presence(),
|
get_presence(),
|
||||||
receipts_handler.get_receipts_for_room(room_id, now_token.receipt_key),
|
get_receipts(),
|
||||||
self.store.get_recent_events_for_room(
|
self.store.get_recent_events_for_room(
|
||||||
room_id,
|
room_id,
|
||||||
limit=limit,
|
limit=limit,
|
||||||
|
|
Loading…
Reference in a new issue