mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-22 17:42:45 +02:00
Use attributed string for thread root message
This commit is contained in:
@@ -188,7 +188,7 @@ final class ThreadListViewModel: ThreadListViewModelProtocol {
|
||||
notificationStatus: notificationStatus)
|
||||
}
|
||||
|
||||
private func rootMessageText(forThread thread: MXThread) -> String? {
|
||||
private func rootMessageText(forThread thread: MXThread) -> NSAttributedString? {
|
||||
guard let eventFormatter = eventFormatter else {
|
||||
return nil
|
||||
}
|
||||
@@ -196,9 +196,9 @@ final class ThreadListViewModel: ThreadListViewModelProtocol {
|
||||
return nil
|
||||
}
|
||||
let formatterError = UnsafeMutablePointer<MXKEventFormatterError>.allocate(capacity: 1)
|
||||
return eventFormatter.string(from: message,
|
||||
with: roomState,
|
||||
error: formatterError)
|
||||
return eventFormatter.attributedString(from: message,
|
||||
with: roomState,
|
||||
error: formatterError)
|
||||
}
|
||||
|
||||
private func lastMessageTextAndTime(forThread thread: MXThread) -> (String?, String?) {
|
||||
|
||||
@@ -43,7 +43,7 @@ class ThreadTableViewCell: UITableViewCell {
|
||||
rootMessageAvatarView.avatarImageView.image = nil
|
||||
}
|
||||
rootMessageSenderLabel.text = viewModel.rootMessageSenderDisplayName
|
||||
rootMessageContentLabel.text = viewModel.rootMessageText
|
||||
rootMessageContentLabel.attributedText = viewModel.rootMessageText
|
||||
lastMessageTimeLabel.text = viewModel.lastMessageTime
|
||||
if let summaryViewModel = viewModel.summaryViewModel {
|
||||
summaryView.configure(withViewModel: summaryViewModel)
|
||||
|
||||
@@ -19,7 +19,7 @@ import Foundation
|
||||
struct ThreadViewModel {
|
||||
var rootMessageSenderAvatar: AvatarViewDataProtocol?
|
||||
var rootMessageSenderDisplayName: String?
|
||||
var rootMessageText: String?
|
||||
var rootMessageText: NSAttributedString?
|
||||
var lastMessageTime: String?
|
||||
var summaryViewModel: ThreadSummaryViewModel?
|
||||
var notificationStatus: ThreadNotificationStatus
|
||||
|
||||
Reference in New Issue
Block a user