diff options
author | Matthew Hodgson <matthew@matrix.org> | 2017-11-29 18:27:05 +0000 |
---|---|---|
committer | Matthew Hodgson <matthew@matrix.org> | 2017-11-29 18:27:05 +0000 |
commit | 3241c7aac3dc114a6abce46e5d241f42ed35a7fe (patch) | |
tree | 81dc0c83a96b1f0a720c8fc3f73c40bea0c0a03c /synapse/handlers/profile.py | |
parent | Add user_directory_include_pattern config param to expand search results to a... (diff) | |
download | synapse-3241c7aac3dc114a6abce46e5d241f42ed35a7fe.tar.xz |
untested WIP but might actually work
Diffstat (limited to 'synapse/handlers/profile.py')
-rw-r--r-- | synapse/handlers/profile.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/synapse/handlers/profile.py b/synapse/handlers/profile.py index 5e5b1952dd..0a394a10b2 100644 --- a/synapse/handlers/profile.py +++ b/synapse/handlers/profile.py @@ -36,6 +36,8 @@ class ProfileHandler(BaseHandler): "profile", self.on_profile_query ) + self.user_directory_handler = hs.get_user_directory_handler() + self.clock.looping_call(self._update_remote_profile_cache, self.PROFILE_UPDATE_MS) @defer.inlineCallbacks @@ -139,6 +141,12 @@ class ProfileHandler(BaseHandler): target_user.localpart, new_displayname ) + if self.hs.config.user_directory_include_pattern: + profile = yield self.store.get_profileinfo(target_user.localpart) + yield self.user_directory_handler.handle_local_profile_change( + target_user.to_string(), profile + ) + yield self._update_join_states(requester, target_user) @defer.inlineCallbacks @@ -183,6 +191,12 @@ class ProfileHandler(BaseHandler): target_user.localpart, new_avatar_url ) + if self.hs.config.user_directory_include_pattern: + profile = yield self.store.get_profileinfo(target_user.localpart) + yield self.user_directory_handler.handle_local_profile_change( + target_user.user_id, profile + ) + yield self._update_join_states(requester, target_user) @defer.inlineCallbacks |