mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-05 12:14:56 -04:00
Add option to allow profile queries without sharing a room (#6523)
This commit is contained in:
parent
6920d88892
commit
bfb95654c9
5 changed files with 28 additions and 1 deletions
|
@ -295,12 +295,16 @@ class BaseProfileHandler(BaseHandler):
|
|||
be found to be in any room the server is in, and therefore the query
|
||||
is denied.
|
||||
"""
|
||||
|
||||
# Implementation of MSC1301: don't allow looking up profiles if the
|
||||
# requester isn't in the same room as the target. We expect requester to
|
||||
# be None when this function is called outside of a profile query, e.g.
|
||||
# when building a membership event. In this case, we must allow the
|
||||
# lookup.
|
||||
if not self.hs.config.require_auth_for_profile_requests or not requester:
|
||||
if (
|
||||
not self.hs.config.limit_profile_requests_to_users_who_share_rooms
|
||||
or not requester
|
||||
):
|
||||
return
|
||||
|
||||
# Always allow the user to query their own profile.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue