mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Remove now unnecessary RoomListSummary lastMessageFormattedTimestamp
This commit is contained in:
committed by
Stefan Ceriu
parent
899c33a5ad
commit
41b18cfd52
@@ -41,7 +41,6 @@ struct RoomSummary {
|
||||
let heroes: [UserProfileProxy]
|
||||
let lastMessage: AttributedString?
|
||||
let lastMessageDate: Date?
|
||||
let lastMessageFormattedTimestamp: String?
|
||||
let unreadMessagesCount: UInt
|
||||
let unreadMentionsCount: UInt
|
||||
let unreadNotificationsCount: UInt
|
||||
@@ -96,8 +95,7 @@ extension RoomSummary {
|
||||
avatarURL = nil
|
||||
heroes = []
|
||||
lastMessage = AttributedString(string)
|
||||
lastMessageDate = .now
|
||||
lastMessageFormattedTimestamp = "Now"
|
||||
lastMessageDate = .mock
|
||||
unreadMessagesCount = hasUnreadMessages ? 1 : 0
|
||||
unreadMentionsCount = hasUnreadMentions ? 1 : 0
|
||||
unreadNotificationsCount = hasUnreadNotifications ? 1 : 0
|
||||
|
||||
@@ -243,12 +243,10 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
|
||||
|
||||
var attributedLastMessage: AttributedString?
|
||||
var lastMessageDate: Date?
|
||||
var lastMessageFormattedTimestamp: String?
|
||||
|
||||
if let latestRoomMessage = roomDetails.latestEvent {
|
||||
let lastMessage = EventTimelineItemProxy(item: latestRoomMessage, uniqueID: .init("0"))
|
||||
lastMessageDate = lastMessage.timestamp
|
||||
lastMessageFormattedTimestamp = lastMessage.timestamp.formattedMinimal()
|
||||
attributedLastMessage = eventStringBuilder.buildAttributedString(for: lastMessage)
|
||||
}
|
||||
|
||||
@@ -274,7 +272,6 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
|
||||
heroes: roomInfo.heroes.map(UserProfileProxy.init),
|
||||
lastMessage: attributedLastMessage,
|
||||
lastMessageDate: lastMessageDate,
|
||||
lastMessageFormattedTimestamp: lastMessageFormattedTimestamp,
|
||||
unreadMessagesCount: UInt(roomInfo.numUnreadMessages),
|
||||
unreadMentionsCount: UInt(roomInfo.numUnreadMentions),
|
||||
unreadNotificationsCount: UInt(roomInfo.numUnreadNotifications),
|
||||
|
||||
Reference in New Issue
Block a user