Make the RoomInfo isPrivate field optional and handle it accordingly.

This commit is contained in:
Stefan Ceriu
2025-06-25 17:15:21 +03:00
committed by Stefan Ceriu
parent 11c7d07e76
commit bfd97cd560
6 changed files with 16 additions and 10 deletions
@@ -79,12 +79,18 @@ extension BaseRoomInfoProxyProtocol {
extension RoomInfoProxyProtocol {
/// A room might be non public but also not private given the fact that the join rule might be missing or unsupported.
var isPrivate: Bool {
switch joinRule {
case .invite, .knock, .restricted, .knockRestricted:
var isPrivate: Bool? {
guard let joinRule else {
return nil
}
return switch joinRule {
case .invite, .knock, .restricted, .knockRestricted, .private:
true
default:
case .public:
false
case .custom: // We don't know how to handle this
nil
}
}