mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-12-11 16:34:20 -05:00
Do not show invite-only rooms in spaces summary (unless joined/invited). (#10109)
This commit is contained in:
parent
4deaebfe00
commit
3cf6b34b4e
1
changelog.d/10109.bugfix
Normal file
1
changelog.d/10109.bugfix
Normal file
@ -0,0 +1 @@
|
|||||||
|
Fix a bug introduced in v1.35.0 where invite-only rooms would be shown to users in a space who were not invited.
|
@ -26,7 +26,6 @@ from synapse.api.constants import (
|
|||||||
HistoryVisibility,
|
HistoryVisibility,
|
||||||
Membership,
|
Membership,
|
||||||
)
|
)
|
||||||
from synapse.api.errors import AuthError
|
|
||||||
from synapse.events import EventBase
|
from synapse.events import EventBase
|
||||||
from synapse.events.utils import format_event_for_client_v2
|
from synapse.events.utils import format_event_for_client_v2
|
||||||
from synapse.types import JsonDict
|
from synapse.types import JsonDict
|
||||||
@ -456,15 +455,15 @@ class SpaceSummaryHandler:
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
# Otherwise, check if they should be allowed access via membership in a space.
|
# Otherwise, check if they should be allowed access via membership in a space.
|
||||||
try:
|
if self._event_auth_handler.has_restricted_join_rules(
|
||||||
await self._event_auth_handler.check_restricted_join_rules(
|
state_ids, room_version
|
||||||
state_ids, room_version, requester, member_event
|
):
|
||||||
|
allowed_spaces = (
|
||||||
|
await self._event_auth_handler.get_spaces_that_allow_join(state_ids)
|
||||||
)
|
)
|
||||||
except AuthError:
|
if await self._event_auth_handler.is_user_in_rooms(
|
||||||
# The user doesn't have access due to spaces, but might have access
|
allowed_spaces, requester
|
||||||
# another way. Keep trying.
|
):
|
||||||
pass
|
|
||||||
else:
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# If this is a request over federation, check if the host is in the room or
|
# If this is a request over federation, check if the host is in the room or
|
||||||
|
Loading…
Reference in New Issue
Block a user