fix: Unban

This commit is contained in:
Christian Pauly 2020-11-22 21:05:34 +01:00
parent 411d29cc89
commit ab8eb71fee
2 changed files with 3 additions and 6 deletions

View File

@ -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<void> 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,
});

View File

@ -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 =>