Merge branch 'feature/4955_disable_wysiwyg_commands' into 'develop'

MESSENGER 4955 disable WYSIWYG commands

See merge request bwmessenger/bundesmessenger/bundesmessenger-ios!206
This commit is contained in:
JanNiklas Grabowski
2023-09-08 13:46:34 +00:00
3 changed files with 9 additions and 2 deletions

View File

@@ -659,6 +659,7 @@ class BWIBuildSettings: NSObject {
// MARK: WYSIWYG
var enableFeatureWYSIWYGByDefault = true
var enableWYSIWYGCommands = false
// MARK: itunes
var itunesAppLink = ""

View File

@@ -379,7 +379,8 @@ class WysiwygInputToolbarView: MXKRoomInputToolbarView, NibLoadable, HtmlRoomInp
}
private func sendWysiwygMessage(content: WysiwygComposerContent) {
if content.markdown.prefix(while: { $0 == "/" }).count == 1 {
// bwi: #4955 disable WYSIWYG commands
if BWIBuildSettings.shared.enableWYSIWYGCommands && content.markdown.prefix(while: { $0 == "/" }).count == 1 {
let commandText: String
if content.markdown.hasPrefix(MXKSlashCommand.emote.cmd) {
// `/me` command works with markdown content

View File

@@ -128,7 +128,12 @@ class CompletionSuggestionService: CompletionSuggestionServiceProtocol {
items.send([])
currentTextTriggerSubject.send(nil)
case .slash:
currentTextTriggerSubject.send(TextTrigger(key: .slash, text: suggestionPattern.text))
// bwi: #4955 disable WYSIWYG commands
if BWIBuildSettings.shared.enableWYSIWYGCommands {
currentTextTriggerSubject.send(TextTrigger(key: .slash, text: suggestionPattern.text))
} else {
break
}
}
}