mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 19:11:45 +00:00
tombstoned and upgraded rooms implementation
added tests tombstoned room avatar
This commit is contained in:
@@ -56,6 +56,8 @@ struct RoomSummary {
|
||||
let isMarkedUnread: Bool
|
||||
let isFavourite: Bool
|
||||
|
||||
let isTombstoned: Bool
|
||||
|
||||
var hasUnreadMessages: Bool { unreadMessagesCount > 0 }
|
||||
var hasUnreadMentions: Bool { unreadMentionsCount > 0 }
|
||||
var hasUnreadNotifications: Bool { unreadNotificationsCount > 0 }
|
||||
@@ -124,14 +126,19 @@ extension RoomSummary {
|
||||
joinRequestType = nil
|
||||
isMarkedUnread = false
|
||||
isFavourite = false
|
||||
isTombstoned = false
|
||||
}
|
||||
|
||||
// This doesn't have to work properly for DM invites, the heroes are always empty
|
||||
var avatar: RoomAvatar {
|
||||
guard !isTombstoned else {
|
||||
return .tombstoned
|
||||
}
|
||||
|
||||
if isDirect, avatarURL == nil, heroes.count == 1 {
|
||||
.heroes(heroes)
|
||||
return .heroes(heroes)
|
||||
} else {
|
||||
.room(id: id, name: name, avatarURL: avatarURL)
|
||||
return .room(id: id, name: name, avatarURL: avatarURL)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user