summary refs log tree commit diff
path: root/src/timeline/InputBar.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2024-11-17 20:17:39 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2024-11-17 20:17:39 +0100
commit71651b81a8649db49bf3541e1392094270b506fb (patch)
tree5d7692bd5bd5cf3ed6f860ae38292987299deac3 /src/timeline/InputBar.cpp
parentUpdate translations (diff)
downloadnheko-71651b81a8649db49bf3541e1392094270b506fb.tar.xz
Get rid of reply fallback in text messages since MSC2781 is merged
Diffstat (limited to '')
-rw-r--r--src/timeline/InputBar.cpp35
1 files changed, 0 insertions, 35 deletions
diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp
index e967da8c..270e261e 100644
--- a/src/timeline/InputBar.cpp
+++ b/src/timeline/InputBar.cpp
@@ -560,41 +560,6 @@ InputBar::message(const QString &msg, MarkdownOverride useMarkdown, bool rainbow
 
     text.mentions  = generateMentions();
     text.relations = generateRelations();
-    if (!room->reply().isEmpty() && room->thread().isEmpty() && room->edit().isEmpty()) {
-        auto related = room->relatedInfo(room->reply());
-
-        // Skip reply fallbacks to users who would cause a room ping with the fallback.
-        // This should be fine, since in some cases the reply fallback can be omitted now and the
-        // alternative is worse! On Element Android this applies to any substring, but that is their
-        // bug to fix.
-        if (!related.quoted_user.startsWith("@room:")) {
-            QString body;
-            bool firstLine = true;
-            auto lines     = QStringView(related.quoted_body).split(u'\n');
-            for (auto line : std::as_const(lines)) {
-                if (firstLine) {
-                    firstLine = false;
-                    body      = QStringLiteral("> <%1> %2\n").arg(related.quoted_user, line);
-                } else {
-                    body += QStringLiteral("> %1\n").arg(line);
-                }
-            }
-
-            text.body = fmt::format("{}\n{}", body.toStdString(), text.body);
-
-            // NOTE(Nico): rich replies always need a formatted_body!
-            text.format = "org.matrix.custom.html";
-            if ((ChatPage::instance()->userSettings()->markdown() &&
-                 useMarkdown == MarkdownOverride::NOT_SPECIFIED) ||
-                useMarkdown == MarkdownOverride::ON)
-                text.formatted_body =
-                  utils::getFormattedQuoteBody(related, utils::markdownToHtml(msg, rainbowify))
-                    .toStdString();
-            else
-                text.formatted_body =
-                  utils::getFormattedQuoteBody(related, msg.toHtmlEscaped()).toStdString();
-        }
-    }
 
     room->sendMessageEvent(text, mtx::events::EventType::RoomMessage);
 }