diff options
author | Amber Brown <hawkowl@atleastfornow.net> | 2018-05-28 18:57:23 +1000 |
---|---|---|
committer | Amber Brown <hawkowl@atleastfornow.net> | 2018-05-28 18:57:23 +1000 |
commit | 754826a8305b3f32a45367cb6bd8bb26bd489a6b (patch) | |
tree | c5aba5e1e720474b3f94d15bd9202bda0b120e20 /synapse/handlers/user_directory.py | |
parent | pepeightttt (diff) | |
parent | Merge pull request #3288 from matrix-org/rav/no_spam_guests (diff) | |
download | synapse-754826a8305b3f32a45367cb6bd8bb26bd489a6b.tar.xz |
Merge remote-tracking branch 'origin/develop' into 3218-official-prom
Diffstat (limited to 'synapse/handlers/user_directory.py')
-rw-r--r-- | synapse/handlers/user_directory.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/synapse/handlers/user_directory.py b/synapse/handlers/user_directory.py index 714f0195c8..a39f0f7343 100644 --- a/synapse/handlers/user_directory.py +++ b/synapse/handlers/user_directory.py @@ -22,6 +22,7 @@ from synapse.util.metrics import Measure from synapse.util.async import sleep from synapse.types import get_localpart_from_id +from six import iteritems logger = logging.getLogger(__name__) @@ -123,6 +124,13 @@ class UserDirectoryHandler(object): ) @defer.inlineCallbacks + def handle_user_deactivated(self, user_id): + """Called when a user ID is deactivated + """ + yield self.store.remove_from_user_dir(user_id) + yield self.store.remove_from_user_in_public_room(user_id) + + @defer.inlineCallbacks def _unsafe_process(self): # If self.pos is None then means we haven't fetched it from DB if self.pos is None: @@ -403,7 +411,7 @@ class UserDirectoryHandler(object): if change: users_with_profile = yield self.state.get_current_user_in_room(room_id) - for user_id, profile in users_with_profile.iteritems(): + for user_id, profile in iteritems(users_with_profile): yield self._handle_new_user(room_id, user_id, profile) else: users = yield self.store.get_users_in_public_due_to_room(room_id) |