From ab8eb71fee228be8a6ead96d03daf46c3d0c053c Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Sun, 22 Nov 2020 21:05:34 +0100 Subject: [PATCH] fix: Unban --- lib/matrix_api/matrix_api.dart | 4 ++-- lib/src/user.dart | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/matrix_api/matrix_api.dart b/lib/matrix_api/matrix_api.dart index 3331489b..1f1b3099 100644 --- a/lib/matrix_api/matrix_api.dart +++ b/lib/matrix_api/matrix_api.dart @@ -1023,8 +1023,8 @@ class MatrixApi { /// would otherwise be allowed to join according to its join rules. /// https://matrix.org/docs/spec/client_server/r0.6.1#post-matrix-client-r0-rooms-roomid-unban Future unbanInRoom(String roomId, String userId) async { - await request( - RequestType.POST, '/client/r0/rooms/${Uri.encodeComponent(roomId)}/ban', + await request(RequestType.POST, + '/client/r0/rooms/${Uri.encodeComponent(roomId)}/unban', data: { 'user_id': userId, }); diff --git a/lib/src/user.dart b/lib/src/user.dart index 2c7390c9..04d818dd 100644 --- a/lib/src/user.dart +++ b/lib/src/user.dart @@ -163,10 +163,7 @@ class User extends Event { Presence get presence => room.client.presences[id]; /// Whether the client is able to ban/unban this user. - bool get canBan => - membership != Membership.ban && - room.canBan && - powerLevel < room.ownPowerLevel; + bool get canBan => room.canBan && powerLevel < room.ownPowerLevel; /// Whether the client is able to kick this user. bool get canKick =>