about summary refs log tree commit diff
path: root/LibMatrix/RoomTypes/GenericRoom.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-09-17 04:28:20 +0200
committerRory& <root@rory.gay>2024-09-17 04:28:20 +0200
commit92b139e41afd41f3bd3987c14208966d020a948b (patch)
treee21c6ad5bb0c833a8151c9b60bc4f1de22fa5c8d /LibMatrix/RoomTypes/GenericRoom.cs
parentMerge remote-tracking branch 'origin/dev/project-cleanup' (diff)
parentWorking json canonicalisation (diff)
downloadLibMatrix-bak-92b139e41afd41f3bd3987c14208966d020a948b.tar.xz
Merge remote-tracking branch 'origin/dev/e2ee{canonical-json}'
Diffstat (limited to 'LibMatrix/RoomTypes/GenericRoom.cs')
-rw-r--r--LibMatrix/RoomTypes/GenericRoom.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/LibMatrix/RoomTypes/GenericRoom.cs b/LibMatrix/RoomTypes/GenericRoom.cs

index fe2ee8d..b906f08 100644 --- a/LibMatrix/RoomTypes/GenericRoom.cs +++ b/LibMatrix/RoomTypes/GenericRoom.cs
@@ -388,12 +388,12 @@ public class GenericRoom { await Homeserver.ClientHttpClient.PostAsJsonAsync($"/_matrix/client/v3/rooms/{RoomId}/ban", new UserIdAndReason { UserId = userId, Reason = reason }); - public async Task UnbanAsync(string userId) => + public async Task UnbanAsync(string userId, string? reason = null) => await Homeserver.ClientHttpClient.PostAsJsonAsync($"/_matrix/client/v3/rooms/{RoomId}/unban", - new UserIdAndReason { UserId = userId }); + new UserIdAndReason { UserId = userId, Reason = reason}); public async Task InviteUserAsync(string userId, string? reason = null, bool skipExisting = true) { - if (skipExisting && await GetStateAsync<RoomMemberEventContent>("m.room.member", userId) is not null) + if (skipExisting && await GetStateOrNullAsync<RoomMemberEventContent>("m.room.member", userId) is not null) return; await Homeserver.ClientHttpClient.PostAsJsonAsync($"/_matrix/client/v3/rooms/{RoomId}/invite", new UserIdAndReason(userId, reason)); }