Use attributed string for thread root message

This commit is contained in:
ismailgulek
2021-12-03 00:46:55 +03:00
parent a71cf8e92c
commit 1b6735a09f
3 changed files with 6 additions and 6 deletions

View File

@@ -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?) {