mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-18 07:28:28 +02:00
Enable WYSIWYG plain text support
This commit is contained in:
@@ -66,6 +66,7 @@ class WysiwygInputToolbarView: MXKRoomInputToolbarView, NibLoadable, HtmlRoomInp
|
||||
viewModel.callback = { [weak self] result in
|
||||
self?.handleViewModelResult(result)
|
||||
}
|
||||
wysiwygViewModel.plainTextMode = !RiotSettings.shared.enableWysiwygTextFormatting
|
||||
|
||||
inputAccessoryViewForKeyboard = UIView(frame: .zero)
|
||||
|
||||
@@ -130,7 +131,8 @@ class WysiwygInputToolbarView: MXKRoomInputToolbarView, NibLoadable, HtmlRoomInp
|
||||
}
|
||||
|
||||
private func sendWysiwygMessage(content: WysiwygComposerContent) {
|
||||
delegate?.roomInputToolbarView?(self, sendFormattedTextMessage: content.html, withRawText: content.plainText)
|
||||
let html = content.html.isEmpty ? content.plainText : content.html
|
||||
delegate?.roomInputToolbarView?(self, sendFormattedTextMessage: html, withRawText: content.plainText)
|
||||
}
|
||||
|
||||
private func showSendMediaActions() {
|
||||
@@ -207,6 +209,20 @@ class WysiwygInputToolbarView: MXKRoomInputToolbarView, NibLoadable, HtmlRoomInp
|
||||
updatePlaceholderText()
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether text formatting is currently enabled in the composer.
|
||||
var textFormattingEnabled: Bool {
|
||||
get {
|
||||
self.viewModel.textFormattingEnabled
|
||||
}
|
||||
set {
|
||||
self.viewModel.textFormattingEnabled = newValue
|
||||
self.wysiwygViewModel.plainTextMode = !newValue
|
||||
if !newValue {
|
||||
self.wysiwygViewModel.maximised = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Add the voice message toolbar to the composer
|
||||
/// - Parameter voiceMessageToolbarView: the voice message toolbar UIView
|
||||
|
||||
Reference in New Issue
Block a user