mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
tombstoned and upgraded rooms implementation
added tests tombstoned room avatar
This commit is contained in:
@@ -197,6 +197,8 @@ struct HomeScreenRoom: Identifiable, Equatable {
|
||||
|
||||
let canonicalAlias: String?
|
||||
|
||||
let isTombstoned: Bool
|
||||
|
||||
static func placeholder() -> HomeScreenRoom {
|
||||
HomeScreenRoom(id: UUID().uuidString,
|
||||
roomID: nil,
|
||||
@@ -209,7 +211,8 @@ struct HomeScreenRoom: Identifiable, Equatable {
|
||||
timestamp: "Now",
|
||||
lastMessage: placeholderLastMessage,
|
||||
avatar: .room(id: "", name: "", avatarURL: nil),
|
||||
canonicalAlias: nil)
|
||||
canonicalAlias: nil,
|
||||
isTombstoned: false)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,6 +249,7 @@ extension HomeScreenRoom {
|
||||
timestamp: summary.lastMessageDate?.formattedMinimal(),
|
||||
lastMessage: summary.lastMessage,
|
||||
avatar: summary.avatar,
|
||||
canonicalAlias: summary.canonicalAlias)
|
||||
canonicalAlias: summary.canonicalAlias,
|
||||
isTombstoned: summary.isTombstoned)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,7 +217,8 @@ private extension HomeScreenRoom {
|
||||
alternativeAliases: [],
|
||||
hasOngoingCall: false,
|
||||
isMarkedUnread: false,
|
||||
isFavourite: false)
|
||||
isFavourite: false,
|
||||
isTombstoned: false)
|
||||
|
||||
return .init(summary: summary, hideUnreadMessagesBadge: false)
|
||||
}
|
||||
@@ -246,7 +247,8 @@ private extension HomeScreenRoom {
|
||||
alternativeAliases: [],
|
||||
hasOngoingCall: false,
|
||||
isMarkedUnread: false,
|
||||
isFavourite: false)
|
||||
isFavourite: false,
|
||||
isTombstoned: false)
|
||||
|
||||
return .init(summary: summary, hideUnreadMessagesBadge: false)
|
||||
}
|
||||
|
||||
@@ -162,7 +162,8 @@ private extension HomeScreenRoom {
|
||||
alternativeAliases: [],
|
||||
hasOngoingCall: false,
|
||||
isMarkedUnread: false,
|
||||
isFavourite: false)
|
||||
isFavourite: false,
|
||||
isTombstoned: false)
|
||||
|
||||
return .init(summary: summary, hideUnreadMessagesBadge: false)
|
||||
}
|
||||
@@ -191,7 +192,8 @@ private extension HomeScreenRoom {
|
||||
alternativeAliases: [],
|
||||
hasOngoingCall: false,
|
||||
isMarkedUnread: false,
|
||||
isFavourite: false)
|
||||
isFavourite: false,
|
||||
isTombstoned: false)
|
||||
|
||||
return .init(summary: summary, hideUnreadMessagesBadge: false)
|
||||
}
|
||||
|
||||
@@ -135,7 +135,11 @@ struct HomeScreenRoomCell: View {
|
||||
|
||||
@ViewBuilder
|
||||
private var lastMessage: some View {
|
||||
if let lastMessage = room.lastMessage {
|
||||
// If the room is tombstoned, show a specific message, regardless of any last message.
|
||||
if room.isTombstoned {
|
||||
Text(L10n.screenRoomlistTombstonedRoomDescription)
|
||||
.lastMessageFormatting()
|
||||
} else if let lastMessage = room.lastMessage {
|
||||
Text(lastMessage)
|
||||
.lastMessageFormatting()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user