summary refs log tree commit diff
path: root/src/timeline/InputBar.cpp
diff options
context:
space:
mode:
authorJoseph Donofry <joedonofry@gmail.com>2021-02-01 18:42:38 -0500
committerJoseph Donofry <joedonofry@gmail.com>2021-02-01 18:42:38 -0500
commit53c653a228f529bab3753ca99dee18a5bf5342a2 (patch)
treead0ba40d27ca5a515f1f33c29c910e5cf7b20dd7 /src/timeline/InputBar.cpp
parentRemove redundant import and fix visible warning (diff)
parentFix emojis with fe0f in the middle (diff)
downloadnheko-53c653a228f529bab3753ca99dee18a5bf5342a2.tar.xz
Merge remote-tracking branch 'nheko-im/master' into privacy_screen
Diffstat (limited to 'src/timeline/InputBar.cpp')
-rw-r--r--src/timeline/InputBar.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp

index 3cddd613..b31c1f76 100644 --- a/src/timeline/InputBar.cpp +++ b/src/timeline/InputBar.cpp
@@ -251,12 +251,14 @@ InputBar::openFileSelection() } void -InputBar::message(QString msg) +InputBar::message(QString msg, MarkdownOverride useMarkdown) { mtx::events::msg::Text text = {}; text.body = msg.trimmed().toStdString(); - if (ChatPage::instance()->userSettings()->markdown()) { + if ((ChatPage::instance()->userSettings()->markdown() && + useMarkdown == MarkdownOverride::NOT_SPECIFIED) || + useMarkdown == MarkdownOverride::ON) { text.formatted_body = utils::markdownToHtml(msg).toStdString(); // Don't send formatted_body, when we don't need to @@ -477,6 +479,10 @@ InputBar::command(QString command, QString args) room->clearTimeline(); } else if (command == "rotate-megolm-session") { cache::dropOutboundMegolmSession(room->roomId().toStdString()); + } else if (command == "md") { + message(args, MarkdownOverride::ON); + } else if (command == "plain") { + message(args, MarkdownOverride::OFF); } }