|
|
|
@ -152,7 +152,7 @@ class BaseProfileHandler(BaseHandler): |
|
|
|
|
by_admin (bool): Whether this change was made by an administrator. |
|
|
|
|
""" |
|
|
|
|
if not self.hs.is_mine(target_user): |
|
|
|
|
raise SynapseError(400, "User is not hosted on this Home Server") |
|
|
|
|
raise SynapseError(400, "User is not hosted on this homeserver") |
|
|
|
|
|
|
|
|
|
if not by_admin and target_user != requester.user: |
|
|
|
|
raise AuthError(400, "Cannot set another user's displayname") |
|
|
|
@ -207,7 +207,7 @@ class BaseProfileHandler(BaseHandler): |
|
|
|
|
"""target_user is the user whose avatar_url is to be changed; |
|
|
|
|
auth_user is the user attempting to make this change.""" |
|
|
|
|
if not self.hs.is_mine(target_user): |
|
|
|
|
raise SynapseError(400, "User is not hosted on this Home Server") |
|
|
|
|
raise SynapseError(400, "User is not hosted on this homeserver") |
|
|
|
|
|
|
|
|
|
if not by_admin and target_user != requester.user: |
|
|
|
|
raise AuthError(400, "Cannot set another user's avatar_url") |
|
|
|
@ -231,7 +231,7 @@ class BaseProfileHandler(BaseHandler): |
|
|
|
|
def on_profile_query(self, args): |
|
|
|
|
user = UserID.from_string(args["user_id"]) |
|
|
|
|
if not self.hs.is_mine(user): |
|
|
|
|
raise SynapseError(400, "User is not hosted on this Home Server") |
|
|
|
|
raise SynapseError(400, "User is not hosted on this homeserver") |
|
|
|
|
|
|
|
|
|
just_field = args.get("field", None) |
|
|
|
|
|
|
|
|
|