diff options
author | Erik Johnston <erik@matrix.org> | 2016-03-04 16:33:52 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-03-04 16:33:52 +0000 |
commit | beebc0a40fd8abae2c7e1d11c563fc3f3400503b (patch) | |
tree | ea3a29870e7c608701bbf35815f216b95414da0a /synapse | |
parent | Merge pull request #624 from matrix-org/erikj/invite_profile (diff) | |
parent | Always include kicks and bans in full /sync (diff) | |
download | synapse-beebc0a40fd8abae2c7e1d11c563fc3f3400503b.tar.xz |
Merge pull request #625 from matrix-org/erikj/kick_ban_sync
Always include kicks and bans in full /sync
Diffstat (limited to 'synapse')
-rw-r--r-- | synapse/handlers/sync.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py index fded6e4009..26a66814eb 100644 --- a/synapse/handlers/sync.py +++ b/synapse/handlers/sync.py @@ -209,9 +209,9 @@ class SyncHandler(BaseHandler): key=None ) - membership_list = (Membership.INVITE, Membership.JOIN) - if sync_config.filter_collection.include_leave: - membership_list += (Membership.LEAVE, Membership.BAN) + membership_list = ( + Membership.INVITE, Membership.JOIN, Membership.LEAVE, Membership.BAN + ) room_list = yield self.store.get_rooms_for_user_where_membership_is( user_id=sync_config.user.to_string(), @@ -257,6 +257,12 @@ class SyncHandler(BaseHandler): invite=invite, )) 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( "room_key", "s%d" % (event.stream_ordering,) ) |