diff options
author | Erik Johnston <erik@matrix.org> | 2017-06-01 11:36:50 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2017-06-01 11:36:50 +0100 |
commit | 9c7db2491bd051ca733d9556620ba23ceb52918a (patch) | |
tree | f084212d80f94ca427f15490872be058b2698dc6 /synapse/handlers | |
parent | Bug fixes and logging (diff) | |
download | synapse-9c7db2491bd051ca733d9556620ba23ceb52918a.tar.xz |
Fix removing users
Diffstat (limited to 'synapse/handlers')
-rw-r--r-- | synapse/handlers/user_directory.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/handlers/user_directory.py b/synapse/handlers/user_directory.py index 130ff45ec5..85efd61d38 100644 --- a/synapse/handlers/user_directory.py +++ b/synapse/handlers/user_directory.py @@ -294,6 +294,7 @@ class UserDirectoyHandler(object): yield self.store.add_profiles_to_user_dir(room_id, {user_id: profile}) + @defer.inlineCallbacks def _handle_remove_user(self, room_id, user_id): """Called when we might need to remove user to directory @@ -301,10 +302,13 @@ class UserDirectoyHandler(object): room_id (str): room_id that user left or stopped being public that user_id (str) """ + logger.debug("Maybe removing user %r", user_id) + row = yield self.store.get_user_in_directory(user_id) if not row or row["room_id"] != room_id: # Either the user wasn't in directory or we're still in a room that # is public (i.e. the room_id in the database) + logger.debug("Not removing as row: %r", row) return # XXX: Make this faster? @@ -316,6 +320,7 @@ class UserDirectoyHandler(object): if is_public: yield self.store.update_user_in_user_dir(user_id, j_room_id) + logger.debug("Not removing as found other public room: %r", j_room_id) return yield self.store.remove_from_user_dir(user_id) |