diff options
author | Emma [it/its]@Rory& <root@rory.gay> | 2024-01-05 12:22:42 +0100 |
---|---|---|
committer | Emma [it/its]@Rory& <root@rory.gay> | 2024-01-05 12:22:42 +0100 |
commit | f215dca816745ef54f5436d6cea9350d6dcd3982 (patch) | |
tree | 2749bcd4d1297943478b6080d5688ef642ca1d40 /LibMatrix/RoomTypes | |
parent | ToObject and ToJson for MatrixException (diff) | |
download | LibMatrix-f215dca816745ef54f5436d6cea9350d6dcd3982.tar.xz |
Cleanup
Diffstat (limited to 'LibMatrix/RoomTypes')
-rw-r--r-- | LibMatrix/RoomTypes/GenericRoom.cs | 6 |
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(); |