summary refs log tree commit diff
path: root/synapse/handlers/profile.py
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/handlers/profile.py')
-rw-r--r--synapse/handlers/profile.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/synapse/handlers/profile.py b/synapse/handlers/profile.py

index e8892e1220..75227ae34b 100644 --- a/synapse/handlers/profile.py +++ b/synapse/handlers/profile.py
@@ -496,16 +496,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.limit_profile_requests_to_known_users or not requester: - return - - # Always allow the user to query their own profile. - if target_user.to_string() == requester.to_string(): + 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.