Implement emotes (/me) (#1841)

* implement emotes (/me)

requires matthew/emotes branch of matrix-rust-sdk

* changelog + whitespace

* remove apparently superfluous swiftlint

* fix constness

* remove inout params and incorporate review

* switch to new api based on sdk PR feedback

* Bump the RustSDK to v1.1.21

* Address PR comments

---------

Co-authored-by: Stefan Ceriu <stefan.ceriu@gmail.com>
This commit is contained in:
Matthew Hodgson
2023-10-03 14:17:03 +01:00
committed by GitHub
parent e6fa1bac2e
commit 68ec7bbc9e
8 changed files with 52 additions and 22 deletions
@@ -19,4 +19,6 @@ import UIKit
struct EmoteRoomTimelineItemContent: Hashable {
let body: String
var formattedBody: AttributedString?
/// The original textual representation of the formatted body directly from the event (usually HTML code)
var formattedBodyHTMLString: String?
}
@@ -558,7 +558,7 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
formattedBody = attributedStringBuilder.fromPlain(L10n.commonEmote(name, messageContent.body))
}
return .init(body: messageContent.body, formattedBody: formattedBody)
return .init(body: messageContent.body, formattedBody: formattedBody, formattedBodyHTMLString: htmlBody)
}
// MARK: - State Events