mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Remove now unnecessary RoomListSummary lastMessageFormattedTimestamp
This commit is contained in:
committed by
Stefan Ceriu
parent
899c33a5ad
commit
41b18cfd52
@@ -79,8 +79,7 @@ extension RoomSummary {
|
||||
avatarURL: nil,
|
||||
heroes: [],
|
||||
lastMessage: AttributedString("I do not wish to take the trouble to understand mysticism"),
|
||||
lastMessageDate: nil,
|
||||
lastMessageFormattedTimestamp: "14:56",
|
||||
lastMessageDate: .mock,
|
||||
unreadMessagesCount: 0,
|
||||
unreadMentionsCount: 0,
|
||||
unreadNotificationsCount: 0,
|
||||
@@ -103,8 +102,7 @@ extension Array where Element == RoomSummary {
|
||||
avatarURL: nil,
|
||||
heroes: [],
|
||||
lastMessage: AttributedString("I do not wish to take the trouble to understand mysticism"),
|
||||
lastMessageDate: nil,
|
||||
lastMessageFormattedTimestamp: "14:56",
|
||||
lastMessageDate: .mock,
|
||||
unreadMessagesCount: 0,
|
||||
unreadMentionsCount: 0,
|
||||
unreadNotificationsCount: 0,
|
||||
@@ -122,8 +120,7 @@ extension Array where Element == RoomSummary {
|
||||
avatarURL: .mockMXCAvatar,
|
||||
heroes: [],
|
||||
lastMessage: AttributedString("How do you see the Emperor then? You think he keeps office hours?"),
|
||||
lastMessageDate: nil,
|
||||
lastMessageFormattedTimestamp: "2:56 PM",
|
||||
lastMessageDate: .mock,
|
||||
unreadMessagesCount: 2,
|
||||
unreadMentionsCount: 0,
|
||||
unreadNotificationsCount: 2,
|
||||
@@ -141,8 +138,7 @@ extension Array where Element == RoomSummary {
|
||||
avatarURL: nil,
|
||||
heroes: [],
|
||||
lastMessage: try? AttributedString(markdown: "He certainly seemed no *mental genius* to me"),
|
||||
lastMessageDate: nil,
|
||||
lastMessageFormattedTimestamp: "Some time ago",
|
||||
lastMessageDate: .mock,
|
||||
unreadMessagesCount: 3,
|
||||
unreadMentionsCount: 0,
|
||||
unreadNotificationsCount: 0,
|
||||
@@ -160,8 +156,7 @@ extension Array where Element == RoomSummary {
|
||||
avatarURL: nil,
|
||||
heroes: [],
|
||||
lastMessage: AttributedString("There's an archaic measure of time that's called the month"),
|
||||
lastMessageDate: nil,
|
||||
lastMessageFormattedTimestamp: "Just now",
|
||||
lastMessageDate: .mock,
|
||||
unreadMessagesCount: 2,
|
||||
unreadMentionsCount: 2,
|
||||
unreadNotificationsCount: 2,
|
||||
@@ -179,8 +174,7 @@ extension Array where Element == RoomSummary {
|
||||
avatarURL: nil,
|
||||
heroes: [],
|
||||
lastMessage: AttributedString("Clearly, if Earth is powerful enough to do that, it might also be capable of adjusting minds in order to force belief in its radioactivity"),
|
||||
lastMessageDate: nil,
|
||||
lastMessageFormattedTimestamp: "1986",
|
||||
lastMessageDate: .mock,
|
||||
unreadMessagesCount: 1,
|
||||
unreadMentionsCount: 1,
|
||||
unreadNotificationsCount: 1,
|
||||
@@ -198,8 +192,7 @@ extension Array where Element == RoomSummary {
|
||||
avatarURL: nil,
|
||||
heroes: [],
|
||||
lastMessage: AttributedString("Are you groping for the word 'paranoia'?"),
|
||||
lastMessageDate: nil,
|
||||
lastMessageFormattedTimestamp: "きょうはじゅういちがつじゅういちにちです",
|
||||
lastMessageDate: .mock,
|
||||
unreadMessagesCount: 6,
|
||||
unreadMentionsCount: 0,
|
||||
unreadNotificationsCount: 0,
|
||||
@@ -218,7 +211,6 @@ extension Array where Element == RoomSummary {
|
||||
heroes: [],
|
||||
lastMessage: nil,
|
||||
lastMessageDate: nil,
|
||||
lastMessageFormattedTimestamp: nil,
|
||||
unreadMessagesCount: 0,
|
||||
unreadMentionsCount: 0,
|
||||
unreadNotificationsCount: 0,
|
||||
@@ -270,7 +262,6 @@ extension Array where Element == RoomSummary {
|
||||
heroes: [],
|
||||
lastMessage: nil,
|
||||
lastMessageDate: nil,
|
||||
lastMessageFormattedTimestamp: nil,
|
||||
unreadMessagesCount: 0,
|
||||
unreadMentionsCount: 0,
|
||||
unreadNotificationsCount: 0,
|
||||
@@ -289,7 +280,6 @@ extension Array where Element == RoomSummary {
|
||||
heroes: [],
|
||||
lastMessage: nil,
|
||||
lastMessageDate: nil,
|
||||
lastMessageFormattedTimestamp: nil,
|
||||
unreadMessagesCount: 0,
|
||||
unreadMentionsCount: 0,
|
||||
unreadNotificationsCount: 0,
|
||||
|
||||
@@ -243,7 +243,7 @@ extension HomeScreenRoom {
|
||||
isDirect: summary.isDirect,
|
||||
isHighlighted: isHighlighted,
|
||||
isFavourite: summary.isFavourite,
|
||||
timestamp: summary.lastMessageFormattedTimestamp,
|
||||
timestamp: summary.lastMessageDate?.formattedMinimal(),
|
||||
lastMessage: summary.lastMessage,
|
||||
avatar: summary.avatar,
|
||||
canonicalAlias: summary.canonicalAlias)
|
||||
|
||||
@@ -208,7 +208,6 @@ private extension HomeScreenRoom {
|
||||
heroes: [.init(userID: "@someone:somewhere.com")],
|
||||
lastMessage: nil,
|
||||
lastMessageDate: nil,
|
||||
lastMessageFormattedTimestamp: nil,
|
||||
unreadMessagesCount: 0,
|
||||
unreadMentionsCount: 0,
|
||||
unreadNotificationsCount: 0,
|
||||
@@ -237,7 +236,6 @@ private extension HomeScreenRoom {
|
||||
heroes: [.init(userID: "@someone:somewhere.com")],
|
||||
lastMessage: nil,
|
||||
lastMessageDate: nil,
|
||||
lastMessageFormattedTimestamp: nil,
|
||||
unreadMessagesCount: 0,
|
||||
unreadMentionsCount: 0,
|
||||
unreadNotificationsCount: 0,
|
||||
|
||||
@@ -153,7 +153,6 @@ private extension HomeScreenRoom {
|
||||
heroes: [.init(userID: "@someone:somewhere.com")],
|
||||
lastMessage: nil,
|
||||
lastMessageDate: nil,
|
||||
lastMessageFormattedTimestamp: nil,
|
||||
unreadMessagesCount: 0,
|
||||
unreadMentionsCount: 0,
|
||||
unreadNotificationsCount: 0,
|
||||
@@ -182,7 +181,6 @@ private extension HomeScreenRoom {
|
||||
heroes: [.init(userID: "@someone:somewhere.com")],
|
||||
lastMessage: nil,
|
||||
lastMessageDate: nil,
|
||||
lastMessageFormattedTimestamp: nil,
|
||||
unreadMessagesCount: 0,
|
||||
unreadMentionsCount: 0,
|
||||
unreadNotificationsCount: 0,
|
||||
|
||||
@@ -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