fix: Unban
This commit is contained in:
parent
411d29cc89
commit
ab8eb71fee
|
|
@ -1023,8 +1023,8 @@ class MatrixApi {
|
||||||
/// would otherwise be allowed to join according to its join rules.
|
/// 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
|
/// 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 {
|
Future<void> unbanInRoom(String roomId, String userId) async {
|
||||||
await request(
|
await request(RequestType.POST,
|
||||||
RequestType.POST, '/client/r0/rooms/${Uri.encodeComponent(roomId)}/ban',
|
'/client/r0/rooms/${Uri.encodeComponent(roomId)}/unban',
|
||||||
data: {
|
data: {
|
||||||
'user_id': userId,
|
'user_id': userId,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -163,10 +163,7 @@ class User extends Event {
|
||||||
Presence get presence => room.client.presences[id];
|
Presence get presence => room.client.presences[id];
|
||||||
|
|
||||||
/// Whether the client is able to ban/unban this user.
|
/// Whether the client is able to ban/unban this user.
|
||||||
bool get canBan =>
|
bool get canBan => room.canBan && powerLevel < room.ownPowerLevel;
|
||||||
membership != Membership.ban &&
|
|
||||||
room.canBan &&
|
|
||||||
powerLevel < room.ownPowerLevel;
|
|
||||||
|
|
||||||
/// Whether the client is able to kick this user.
|
/// Whether the client is able to kick this user.
|
||||||
bool get canKick =>
|
bool get canKick =>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue