summary refs log tree commit diff
path: root/synapse/handlers/sync.py
diff options
context:
space:
mode:
authorMark Haines <mjark@negativecurvature.net>2015-12-07 13:16:03 +0000
committerMark Haines <mjark@negativecurvature.net>2015-12-07 13:16:03 +0000
commitf7a1cdbbc6f4403ea15ccb9a204630c658d96574 (patch)
tree47abca58487c517936dec82212a04d174feef73c /synapse/handlers/sync.py
parentMerge remote-tracking branch 'origin/master' into develop (diff)
parentOnly include the archived rooms if a include_leave flag in set in the filter (diff)
downloadsynapse-f7a1cdbbc6f4403ea15ccb9a204630c658d96574.tar.xz
Merge pull request #423 from matrix-org/markjh/archived_flag
Only include the archived rooms if a include_leave flag in set in theā€¦
Diffstat (limited to 'synapse/handlers/sync.py')
-rw-r--r--synapse/handlers/sync.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py
index 943ce368ef..24c2b2fad6 100644
--- a/synapse/handlers/sync.py
+++ b/synapse/handlers/sync.py
@@ -186,14 +186,14 @@ class SyncHandler(BaseHandler):
             pagination_config=pagination_config.get_source_config("presence"),
             key=None
         )
+
+        membership_list = (Membership.INVITE, Membership.JOIN)
+        if sync_config.filter.include_leave:
+            membership_list += (Membership.LEAVE, Membership.BAN)
+
         room_list = yield self.store.get_rooms_for_user_where_membership_is(
             user_id=sync_config.user.to_string(),
-            membership_list=(
-                Membership.INVITE,
-                Membership.JOIN,
-                Membership.LEAVE,
-                Membership.BAN
-            )
+            membership_list=membership_list
         )
 
         account_data, account_data_by_room = (