summary refs log tree commit diff
path: root/src/timeline/InputBar.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-03-15 20:59:18 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2021-03-15 20:59:18 +0100
commit8ca3a8b6078ee92aa39e7533d90c5a9e20521aae (patch)
treeaa77991fc7b638b304468f3ba7b1010341d8c92b /src/timeline/InputBar.cpp
parentStore all state events (diff)
downloadnheko-8ca3a8b6078ee92aa39e7533d90c5a9e20521aae.tar.xz
Don't send markdown links in body
fixes #422
Diffstat (limited to '')
-rw-r--r--src/timeline/InputBar.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp

index d5a6a1dd..20a3fe10 100644 --- a/src/timeline/InputBar.cpp +++ b/src/timeline/InputBar.cpp
@@ -264,6 +264,9 @@ InputBar::message(QString msg, MarkdownOverride useMarkdown) useMarkdown == MarkdownOverride::NOT_SPECIFIED) || useMarkdown == MarkdownOverride::ON) { text.formatted_body = utils::markdownToHtml(msg).toStdString(); + // Remove markdown links by completer + text.body = + msg.trimmed().replace(conf::strings::matrixToMarkdownLink, "\\1").toStdString(); // Don't send formatted_body, when we don't need to if (text.formatted_body.find("<") == std::string::npos) @@ -326,6 +329,9 @@ InputBar::emote(QString msg) ChatPage::instance()->userSettings()->markdown()) { emote.formatted_body = html.toStdString(); emote.format = "org.matrix.custom.html"; + // Remove markdown links by completer + emote.body = + msg.trimmed().replace(conf::strings::matrixToMarkdownLink, "\\1").toStdString(); } if (!room->reply().isEmpty()) {