diff options
author | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-08-13 17:14:42 +0100 |
---|---|---|
committer | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-08-13 17:23:49 +0100 |
commit | 80c056c14866d282e9f2d789e20ce52dfebbf863 (patch) | |
tree | 77566f22679b8d4f773217a3ca510267fecdc3c5 /synapse/handlers/profile.py | |
parent | Use new Federation Query API to implement HS->HS fetching of remote users' pr... (diff) | |
download | synapse-80c056c14866d282e9f2d789e20ce52dfebbf863.tar.xz |
Now that HS->HS Profile lookups use Federation Queries, we don't need the 'local_only' antirecursion hack
Diffstat (limited to 'synapse/handlers/profile.py')
-rw-r--r-- | synapse/handlers/profile.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/synapse/handlers/profile.py b/synapse/handlers/profile.py index 950648cc12..6799132054 100644 --- a/synapse/handlers/profile.py +++ b/synapse/handlers/profile.py @@ -50,14 +50,14 @@ class ProfileHandler(BaseHandler): self.store.create_profile(user.localpart) @defer.inlineCallbacks - def get_displayname(self, target_user, local_only=False): + def get_displayname(self, target_user): if target_user.is_mine: displayname = yield self.store.get_profile_displayname( target_user.localpart ) defer.returnValue(displayname) - elif not local_only: + else: try: result = yield self.federation.make_query( destination=target_user.domain, @@ -76,8 +76,6 @@ class ProfileHandler(BaseHandler): logger.exception("Failed to get displayname") else: defer.returnValue(result["displayname"]) - else: - raise SynapseError(400, "User is not hosted on this Home Server") @defer.inlineCallbacks def set_displayname(self, target_user, auth_user, new_displayname): @@ -100,14 +98,14 @@ class ProfileHandler(BaseHandler): ) @defer.inlineCallbacks - def get_avatar_url(self, target_user, local_only=False): + def get_avatar_url(self, target_user): if target_user.is_mine: avatar_url = yield self.store.get_profile_avatar_url( target_user.localpart ) defer.returnValue(avatar_url) - elif not local_only: + else: try: result = yield self.federation.make_query( destination=target_user.domain, @@ -125,8 +123,6 @@ class ProfileHandler(BaseHandler): logger.exception("Failed to get avatar_url") defer.returnValue(result["avatar_url"]) - else: - raise SynapseError(400, "User is not hosted on this Home Server") @defer.inlineCallbacks def set_avatar_url(self, target_user, auth_user, new_avatar_url): |