Use attributed string for thread last message

This commit is contained in:
ismailgulek
2021-12-03 00:55:13 +03:00
parent 1b6735a09f
commit 254a7e8316
3 changed files with 16 additions and 7 deletions

View File

@@ -201,7 +201,7 @@ final class ThreadListViewModel: ThreadListViewModelProtocol {
error: formatterError)
}
private func lastMessageTextAndTime(forThread thread: MXThread) -> (String?, String?) {
private func lastMessageTextAndTime(forThread thread: MXThread) -> (NSAttributedString?, String?) {
guard let eventFormatter = eventFormatter else {
return (nil, nil)
}
@@ -210,9 +210,9 @@ final class ThreadListViewModel: ThreadListViewModelProtocol {
}
let formatterError = UnsafeMutablePointer<MXKEventFormatterError>.allocate(capacity: 1)
return (
eventFormatter.string(from: message,
with: roomState,
error: formatterError),
eventFormatter.attributedString(from: message,
with: roomState,
error: formatterError),
eventFormatter.dateString(from: message, withTime: true)
)
}