Do not add groups to sync results if disabled. (#12408)
This commit is contained in:
parent
d1cd96ce29
commit
1a90c1e3af
|
@ -0,0 +1 @@
|
||||||
|
Do not include groups in the sync response when disabled.
|
|
@ -1155,6 +1155,7 @@ class SyncHandler:
|
||||||
await self.store.get_e2e_unused_fallback_key_types(user_id, device_id)
|
await self.store.get_e2e_unused_fallback_key_types(user_id, device_id)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if self.hs_config.experimental.groups_enabled:
|
||||||
logger.debug("Fetching group data")
|
logger.debug("Fetching group data")
|
||||||
await self._generate_sync_entry_for_groups(sync_result_builder)
|
await self._generate_sync_entry_for_groups(sync_result_builder)
|
||||||
|
|
||||||
|
|
|
@ -301,8 +301,7 @@ class SyncRestServlet(RestServlet):
|
||||||
if archived:
|
if archived:
|
||||||
response["rooms"][Membership.LEAVE] = archived
|
response["rooms"][Membership.LEAVE] = archived
|
||||||
|
|
||||||
# By the time we get here groups is no longer optional.
|
if sync_result.groups is not None:
|
||||||
assert sync_result.groups is not None
|
|
||||||
if sync_result.groups.join:
|
if sync_result.groups.join:
|
||||||
response["groups"][Membership.JOIN] = sync_result.groups.join
|
response["groups"][Membership.JOIN] = sync_result.groups.join
|
||||||
if sync_result.groups.invite:
|
if sync_result.groups.invite:
|
||||||
|
|
Loading…
Reference in New Issue