summary refs log tree commit diff
path: root/src/Utils.cpp
diff options
context:
space:
mode:
authortargetakhil <targetakhil@gmail.com>2021-04-18 11:22:44 +0530
committertargetakhil <targetakhil@gmail.com>2021-04-18 11:22:44 +0530
commit2dfa40e017c9880164936b50a0ab698dd83a125b (patch)
tree1532ef861f3fb0c3ddcee3a5fbcbdab6b11fd420 /src/Utils.cpp
parentmove detection code to nheko namespace and fix a few other bugs (diff)
downloadnheko-2dfa40e017c9880164936b50a0ab698dd83a125b.tar.xz
strip reply fallbacks from forwarded message
Diffstat (limited to 'src/Utils.cpp')
-rw-r--r--src/Utils.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/Utils.cpp b/src/Utils.cpp

index ca2d3adc..11e7b1af 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp
@@ -63,19 +63,13 @@ utils::stripReplyFallbacks(const TimelineEvent &event, std::string id, QString r // get body, strip reply fallback, then transform the event to text, if it is a media event // etc related.quoted_body = QString::fromStdString(mtx::accessors::body(event)); - QRegularExpression plainQuote("^>.*?$\n?", QRegularExpression::MultilineOption); - while (related.quoted_body.startsWith(">")) - related.quoted_body.remove(plainQuote); - if (related.quoted_body.startsWith("\n")) - related.quoted_body.remove(0, 1); + stripReplyFromBody(related.quoted_body); related.quoted_body = utils::getQuoteBody(related); related.quoted_body.replace("@room", QString::fromUtf8("@\u2060room")); // get quoted body and strip reply fallback related.quoted_formatted_body = mtx::accessors::formattedBodyWithFallback(event); - related.quoted_formatted_body.remove(QRegularExpression( - "<mx-reply>.*</mx-reply>", QRegularExpression::DotMatchesEverythingOption)); - related.quoted_formatted_body.replace("@room", "@\u2060aroom"); + stripReplyFromFormattedBody(related.quoted_formatted_body); related.room = room_id_; return related;