From 91319ba62de889bde645b6f1df4dd6a960ee7de4 Mon Sep 17 00:00:00 2001 From: Rory& Date: Sun, 21 Sep 2025 15:49:54 +0200 Subject: Dependency updates, some fixes, partial msc2545 support --- LibMatrix/RoomTypes/GenericRoom.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'LibMatrix/RoomTypes') diff --git a/LibMatrix/RoomTypes/GenericRoom.cs b/LibMatrix/RoomTypes/GenericRoom.cs index 0077acb..58e5434 100644 --- a/LibMatrix/RoomTypes/GenericRoom.cs +++ b/LibMatrix/RoomTypes/GenericRoom.cs @@ -704,6 +704,18 @@ public class GenericRoom { } public async Task> GetHomeserversInRoom() => (await GetMemberIdsListAsync("join")).Select(x => x.Split(':', 2)[1]).Distinct().ToList(); + + public async Task IsJoinedAsync() { + try { + var member = await GetStateOrNullAsync(RoomMemberEventContent.EventId, Homeserver.UserId); + return member?.Membership == "join"; + } + catch (MatrixException e) { + if (e.ErrorCode == "M_NOT_FOUND") return false; + if (e.ErrorCode == "M_FORBIDDEN") return false; + throw; + } + } } public class RoomIdResponse { -- cgit 1.5.1