From f408d511a6aab696e0d4ba42a341a9248a3e68a9 Mon Sep 17 00:00:00 2001 From: miruka Date: Sun, 12 Jul 2020 20:40:32 -0400 Subject: [PATCH] Fix Room.can_xyz attributes The attributes by mistake used nio.AsyncClient.user instead of the proper user_id. If the user logged in with a partial username instead of typing their full ID, the can_ attributes (e.g. can_kick) would always be False. --- src/backend/matrix_client.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backend/matrix_client.py b/src/backend/matrix_client.py index 892d678e..2a831283 100644 --- a/src/backend/matrix_client.py +++ b/src/backend/matrix_client.py @@ -1684,9 +1684,9 @@ class MatrixClient(nio.AsyncClient): guests_allowed = room.guest_access == "can_join", default_power_level = levels.defaults.users_default, - can_invite = levels.can_user_invite(self.user), - can_kick = levels.can_user_kick(self.user), - can_redact_all = levels.can_user_redact(self.user), + can_invite = levels.can_user_invite(self.user_id), + can_kick = levels.can_user_kick(self.user_id), + can_redact_all = levels.can_user_redact(self.user_id), can_send_messages = can_send_msg(), can_set_name = can_send_state("m.room.name"), can_set_topic = can_send_state("m.room.topic"),