mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
Only include the archived rooms if a include_leave flag in set in the filter
This commit is contained in:
parent
3c85a317d6
commit
660dee94af
@ -143,6 +143,10 @@ class FilterCollection(object):
|
|||||||
self.filter_json.get("account_data", {})
|
self.filter_json.get("account_data", {})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
self.include_leave = self.filter_json.get("room", {}).get(
|
||||||
|
"include_leave", False
|
||||||
|
)
|
||||||
|
|
||||||
def timeline_limit(self):
|
def timeline_limit(self):
|
||||||
return self.room_timeline_filter.limit()
|
return self.room_timeline_filter.limit()
|
||||||
|
|
||||||
|
@ -186,14 +186,14 @@ class SyncHandler(BaseHandler):
|
|||||||
pagination_config=pagination_config.get_source_config("presence"),
|
pagination_config=pagination_config.get_source_config("presence"),
|
||||||
key=None
|
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(
|
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(),
|
||||||
membership_list=(
|
membership_list=membership_list
|
||||||
Membership.INVITE,
|
|
||||||
Membership.JOIN,
|
|
||||||
Membership.LEAVE,
|
|
||||||
Membership.BAN
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
account_data, account_data_by_room = (
|
account_data, account_data_by_room = (
|
||||||
|
Loading…
Reference in New Issue
Block a user