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
@@ -615,10 +615,16 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
} else {
text = messageTimelineItem.body
}
case .emote(let emoteItem):
if ServiceLocator.shared.settings.richTextEditorEnabled, let formattedBodyHTMLString = emoteItem.formattedBodyHTMLString {
text = "/me " + formattedBodyHTMLString
} else {
text = "/me " + messageTimelineItem.body
}
default:
text = messageTimelineItem.body
}
actionsSubject.send(.composer(action: .setText(text: text)))
actionsSubject.send(.composer(action: .setMode(mode: .edit(originalItemId: messageTimelineItem.id))))
case .copyPermalink: