Apply the logic from the previous commit and the JoinRoomProxy to the KnockedRoomProxy

This commit is contained in:
Stefan Ceriu
2025-05-26 09:16:23 +03:00
committed by Stefan Ceriu
parent ae42540ec0
commit 54a4656469
2 changed files with 18 additions and 21 deletions
@@ -915,12 +915,16 @@ class ClientProxy: ClientProxyProtocol {
return try await .invited(InvitedRoomProxy(room: room))
case .knocked:
if appSettings.knockingEnabled {
return try await .knocked(KnockedRoomProxy(roomListItem: roomListItem,
roomPreview: roomListItem.previewRoom(via: []),
ownUserID: userID))
guard appSettings.knockingEnabled else {
return nil
}
return nil
guard let room = try client.getRoom(roomId: roomID) else {
MXLog.error("Could not find room with ID: \(roomID)")
return nil
}
return try await .knocked(KnockedRoomProxy(room: room))
case .joined:
guard let room = try client.getRoom(roomId: roomID) else {
MXLog.error("Could not find room with ID: \(roomID)")