0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-12-15 01:53:58 +01:00

Merge pull request #625 from matrix-org/erikj/kick_ban_sync

Always include kicks and bans in full /sync
This commit is contained in:
Erik Johnston 2016-03-04 16:33:52 +00:00
commit beebc0a40f

View file

@ -209,9 +209,9 @@ class SyncHandler(BaseHandler):
key=None key=None
) )
membership_list = (Membership.INVITE, Membership.JOIN) membership_list = (
if sync_config.filter_collection.include_leave: Membership.INVITE, Membership.JOIN, Membership.LEAVE, Membership.BAN
membership_list += (Membership.LEAVE, Membership.BAN) )
room_list = yield self.store.get_rooms_for_user_where_membership_is( room_list = yield self.store.get_rooms_for_user_where_membership_is(
user_id=sync_config.user.to_string(), user_id=sync_config.user.to_string(),
@ -257,6 +257,12 @@ class SyncHandler(BaseHandler):
invite=invite, invite=invite,
)) ))
elif event.membership in (Membership.LEAVE, Membership.BAN): elif event.membership in (Membership.LEAVE, Membership.BAN):
# Always send down rooms we were banned or kicked from.
if not sync_config.filter_collection.include_leave:
if event.membership == Membership.LEAVE:
if sync_config.user.to_string() == event.sender:
continue
leave_token = now_token.copy_and_replace( leave_token = now_token.copy_and_replace(
"room_key", "s%d" % (event.stream_ordering,) "room_key", "s%d" % (event.stream_ordering,)
) )