mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +00:00
change: stricter private timeline media visibility
This commit is contained in:
@@ -92,7 +92,7 @@ class TimelineViewModel: TimelineViewModelType, TimelineViewModelProtocol {
|
|||||||
case .always:
|
case .always:
|
||||||
false
|
false
|
||||||
case .privateOnly:
|
case .privateOnly:
|
||||||
roomProxy.infoPublisher.value.isPublic
|
!roomProxy.infoPublisher.value.isPrivate
|
||||||
case .never:
|
case .never:
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
@@ -538,7 +538,7 @@ class TimelineViewModel: TimelineViewModelType, TimelineViewModelProtocol {
|
|||||||
case .privateOnly:
|
case .privateOnly:
|
||||||
guard let self else { return Just(false).eraseToAnyPublisher() }
|
guard let self else { return Just(false).eraseToAnyPublisher() }
|
||||||
return roomProxy.infoPublisher
|
return roomProxy.infoPublisher
|
||||||
.map(\.isPublic)
|
.map { !$0.isPrivate }
|
||||||
.removeDuplicates()
|
.removeDuplicates()
|
||||||
.receive(on: DispatchQueue.main)
|
.receive(on: DispatchQueue.main)
|
||||||
.eraseToAnyPublisher()
|
.eraseToAnyPublisher()
|
||||||
|
|||||||
@@ -49,6 +49,17 @@ struct RoomInfoProxy: BaseRoomInfoProxyProtocol {
|
|||||||
|
|
||||||
var isDirect: Bool { roomInfo.isDirect }
|
var isDirect: Bool { roomInfo.isDirect }
|
||||||
var isPublic: Bool { roomInfo.isPublic }
|
var isPublic: Bool { roomInfo.isPublic }
|
||||||
|
|
||||||
|
// 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 roomInfo.joinRule {
|
||||||
|
case .invite, .knock, .restricted, .knockRestricted:
|
||||||
|
true
|
||||||
|
default:
|
||||||
|
false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var isSpace: Bool { roomInfo.isSpace }
|
var isSpace: Bool { roomInfo.isSpace }
|
||||||
var isTombstoned: Bool { roomInfo.isTombstoned }
|
var isTombstoned: Bool { roomInfo.isTombstoned }
|
||||||
var isFavourite: Bool { roomInfo.isFavourite }
|
var isFavourite: Bool { roomInfo.isFavourite }
|
||||||
|
|||||||
Reference in New Issue
Block a user