about summary refs log tree commit diff
path: root/LibMatrix/RoomTypes/PolicyRoom.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-11-14 10:48:26 +0100
committerRory& <root@rory.gay>2025-11-14 10:48:26 +0100
commit3558ba25896876b0c546f4c2decbb0671187745b (patch)
tree4e1a21a109726bbd7768e8a63b36f720c36f97f9 /LibMatrix/RoomTypes/PolicyRoom.cs
parentHandle some non-browser network errors, clean up some well known resolver stuff (diff)
downloadLibMatrix-3558ba25896876b0c546f4c2decbb0671187745b.tar.xz
StateEvent -> MatrixEvent
Diffstat (limited to 'LibMatrix/RoomTypes/PolicyRoom.cs')
-rw-r--r--LibMatrix/RoomTypes/PolicyRoom.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/LibMatrix/RoomTypes/PolicyRoom.cs b/LibMatrix/RoomTypes/PolicyRoom.cs

index c6eec63..e4fa6ae 100644 --- a/LibMatrix/RoomTypes/PolicyRoom.cs +++ b/LibMatrix/RoomTypes/PolicyRoom.cs
@@ -7,13 +7,13 @@ namespace LibMatrix.RoomTypes; public class PolicyRoom(AuthenticatedHomeserverGeneric homeserver, string roomId) : GenericRoom(homeserver, roomId) { public const string TypeName = "support.feline.policy.lists.msc.v1"; - + public static readonly FrozenSet<string> UserPolicyEventTypes = EventContent.GetMatchingEventTypes<UserPolicyRuleEventContent>().ToFrozenSet(); public static readonly FrozenSet<string> ServerPolicyEventTypes = EventContent.GetMatchingEventTypes<ServerPolicyRuleEventContent>().ToFrozenSet(); public static readonly FrozenSet<string> RoomPolicyEventTypes = EventContent.GetMatchingEventTypes<RoomPolicyRuleEventContent>().ToFrozenSet(); public static readonly FrozenSet<string> SpecPolicyEventTypes = [..UserPolicyEventTypes, ..ServerPolicyEventTypes, ..RoomPolicyEventTypes]; - public async IAsyncEnumerable<StateEventResponse> GetPoliciesAsync() { + public async IAsyncEnumerable<MatrixEventResponse> GetPoliciesAsync() { var fullRoomState = GetFullStateAsync(); await foreach (var eventResponse in fullRoomState) { if (SpecPolicyEventTypes.Contains(eventResponse!.Type)) { @@ -22,7 +22,7 @@ public class PolicyRoom(AuthenticatedHomeserverGeneric homeserver, string roomId } } - public async IAsyncEnumerable<StateEventResponse> GetUserPoliciesAsync() { + public async IAsyncEnumerable<MatrixEventResponse> GetUserPoliciesAsync() { var fullRoomState = GetPoliciesAsync(); await foreach (var eventResponse in fullRoomState) { if (UserPolicyEventTypes.Contains(eventResponse!.Type)) { @@ -31,7 +31,7 @@ public class PolicyRoom(AuthenticatedHomeserverGeneric homeserver, string roomId } } - public async IAsyncEnumerable<StateEventResponse> GetServerPoliciesAsync() { + public async IAsyncEnumerable<MatrixEventResponse> GetServerPoliciesAsync() { var fullRoomState = GetPoliciesAsync(); await foreach (var eventResponse in fullRoomState) { if (ServerPolicyEventTypes.Contains(eventResponse!.Type)) { @@ -40,7 +40,7 @@ public class PolicyRoom(AuthenticatedHomeserverGeneric homeserver, string roomId } } - public async IAsyncEnumerable<StateEventResponse> GetRoomPoliciesAsync() { + public async IAsyncEnumerable<MatrixEventResponse> GetRoomPoliciesAsync() { var fullRoomState = GetPoliciesAsync(); await foreach (var eventResponse in fullRoomState) { if (RoomPolicyEventTypes.Contains(eventResponse!.Type)) {