tombstoned and upgraded rooms implementation

added tests

tombstoned room avatar
This commit is contained in:
Mauro Romito
2025-06-03 12:52:31 +02:00
committed by Mauro
parent b628f5d2c2
commit 155b47e849
76 changed files with 438 additions and 171 deletions
@@ -33,6 +33,10 @@ struct RoomInfoProxy: BaseRoomInfoProxyProtocol {
var avatarURL: URL? { roomInfo.avatarUrl.flatMap(URL.init) }
/// The room's avatar info for use in a ``RoomAvatarImage``.
var avatar: RoomAvatar {
guard successor == nil else {
return .tombstoned
}
if isDirect, avatarURL == nil, heroes.count == 1 {
return .heroes(heroes.map(UserProfileProxy.init))
}
@@ -61,7 +65,7 @@ struct RoomInfoProxy: BaseRoomInfoProxyProtocol {
}
var isSpace: Bool { roomInfo.isSpace }
var tombstoneInfo: SuccessorRoom? { roomInfo.successorRoom }
var successor: SuccessorRoom? { roomInfo.successorRoom }
var isFavourite: Bool { roomInfo.isFavourite }
var canonicalAlias: String? { roomInfo.canonicalAlias }
var alternativeAliases: [String] { roomInfo.alternativeAliases }