From 3346c55e34d4f3f847dfe8113cb367e4bc72a2e5 Mon Sep 17 00:00:00 2001 From: Rory& Date: Mon, 16 Sep 2024 08:46:54 +0200 Subject: Fix room joining, power levels --- LibMatrix/RoomTypes/GenericRoom.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'LibMatrix/RoomTypes/GenericRoom.cs') diff --git a/LibMatrix/RoomTypes/GenericRoom.cs b/LibMatrix/RoomTypes/GenericRoom.cs index b22ce2f..4641349 100644 --- a/LibMatrix/RoomTypes/GenericRoom.cs +++ b/LibMatrix/RoomTypes/GenericRoom.cs @@ -210,10 +210,11 @@ public class GenericRoom { public async Task JoinAsync(string[]? homeservers = null, string? reason = null, bool checkIfAlreadyMember = true) { if (checkIfAlreadyMember) try { - _ = await GetCreateEventAsync(); - return new RoomIdResponse { - RoomId = RoomId - }; + var ser = await GetStateEventOrNullAsync(RoomMemberEventContent.EventId, Homeserver.UserId); + if (ser?.TypedContent is RoomMemberEventContent { Membership: "join" }) + return new RoomIdResponse { + RoomId = RoomId + }; } catch { } //ignore -- cgit 1.4.1