about summary refs log tree commit diff
path: root/LibMatrix/RoomTypes/GenericRoom.cs
diff options
context:
space:
mode:
authorEmma [it/its]@Rory& <root@rory.gay>2024-01-05 12:22:42 +0100
committerEmma [it/its]@Rory& <root@rory.gay>2024-01-05 12:22:42 +0100
commitf215dca816745ef54f5436d6cea9350d6dcd3982 (patch)
tree2749bcd4d1297943478b6080d5688ef642ca1d40 /LibMatrix/RoomTypes/GenericRoom.cs
parentToObject and ToJson for MatrixException (diff)
downloadLibMatrix-f215dca816745ef54f5436d6cea9350d6dcd3982.tar.xz
Cleanup
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 9e2cb67..bfb7f43 100644
--- a/LibMatrix/RoomTypes/GenericRoom.cs
+++ b/LibMatrix/RoomTypes/GenericRoom.cs
@@ -184,7 +184,7 @@ public class GenericRoom {
         else sw.Restart();
         foreach (var resp in result.Chunk) {
             if (resp?.Type != "m.room.member") continue;
-            if (joinedOnly && (resp.TypedContent as RoomMemberEventContent)?.Membership is not "join") continue;
+            if (joinedOnly && resp.RawContent?["membership"]?.GetValue<string>() != "join") continue;
             yield return resp;
         }
 
@@ -209,7 +209,7 @@ public class GenericRoom {
         var members = new List<StateEventResponse>();
         foreach (var resp in result.Chunk) {
             if (resp?.Type != "m.room.member") continue;
-            if (joinedOnly && (resp.TypedContent as RoomMemberEventContent)?.Membership is not "join") continue;
+            if (joinedOnly && resp.RawContent?["membership"]?.GetValue<string>() != "join") continue;
             members.Add(resp);
         }
 
@@ -267,7 +267,7 @@ public class GenericRoom {
                 var memberList = new List<string>();
                 int memberCount = 0;
                 await foreach (var member in members)
-                    memberList.Add((member.TypedContent is RoomMemberEventContent memberEvent ? memberEvent.DisplayName : "") ?? "");
+                    memberList.Add(member.RawContent?["displayname"]?.GetValue<string>() ?? "");
                 memberCount = memberList.Count;
                 memberList.RemoveAll(string.IsNullOrWhiteSpace);
                 memberList = memberList.OrderBy(x => x).ToList();