1 files changed, 4 insertions, 1 deletions
diff --git a/LibMatrix/RoomTypes/GenericRoom.cs b/LibMatrix/RoomTypes/GenericRoom.cs
index 6d9a499..550eb58 100644
--- a/LibMatrix/RoomTypes/GenericRoom.cs
+++ b/LibMatrix/RoomTypes/GenericRoom.cs
@@ -321,6 +321,9 @@ public class GenericRoom {
public Task<RoomCreateEventContent?> GetCreateEventAsync() =>
GetStateAsync<RoomCreateEventContent>("m.room.create");
+ public Task<RoomPolicyServerEventContent?> GetPolicyServerAsync() =>
+ GetStateAsync<RoomPolicyServerEventContent>(RoomPolicyServerEventContent.EventId);
+
public async Task<string?> GetRoomType() {
var res = await GetStateAsync<RoomCreateEventContent>("m.room.create");
return res.Type;
@@ -393,7 +396,7 @@ public class GenericRoom {
new UserIdAndReason { UserId = userId, Reason = reason });
public async Task InviteUserAsync(string userId, string? reason = null, bool skipExisting = true) {
- if (skipExisting && await GetStateOrNullAsync<RoomMemberEventContent>("m.room.member", userId) is not { Membership: "leave" or "ban" or "join" })
+ if (skipExisting && await GetStateOrNullAsync<RoomMemberEventContent>("m.room.member", userId) is { Membership: "ban" or "join" })
return;
await Homeserver.ClientHttpClient.PostAsJsonAsync($"/_matrix/client/v3/rooms/{RoomId}/invite", new UserIdAndReason(userId, reason));
}
|