MESSENGER 4955 disable WYSIWYG commands

This commit is contained in:
JanNiklas Grabowski
2023-09-07 16:33:23 +02:00
parent ac41d08e53
commit a8b759b63b
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
}
}
}