|
|
@ -42,24 +42,12 @@ namespace utils { |
|
|
|
using TimelineEvent = mtx::events::collections::TimelineEvents; |
|
|
|
using TimelineEvent = mtx::events::collections::TimelineEvents; |
|
|
|
|
|
|
|
|
|
|
|
//! Helper function to remove reply fallback from body
|
|
|
|
//! Helper function to remove reply fallback from body
|
|
|
|
static void |
|
|
|
void |
|
|
|
stripReplyFromBody(QString &body) |
|
|
|
stripReplyFromBody(QString &body); |
|
|
|
{ |
|
|
|
|
|
|
|
QRegularExpression plainQuote("^>.*?$\n?", QRegularExpression::MultilineOption); |
|
|
|
|
|
|
|
while (body.startsWith(">")) |
|
|
|
|
|
|
|
body.remove(plainQuote); |
|
|
|
|
|
|
|
if (body.startsWith("\n")) |
|
|
|
|
|
|
|
body.remove(0, 1); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//! Helper function to remove reply fallback from formatted body
|
|
|
|
//! Helper function to remove reply fallback from formatted body
|
|
|
|
static void |
|
|
|
void |
|
|
|
stripReplyFromFormattedBody(QString &formatted_body) |
|
|
|
stripReplyFromFormattedBody(QString &formatted_body); |
|
|
|
{ |
|
|
|
|
|
|
|
formatted_body.remove(QRegularExpression("<mx-reply>.*</mx-reply>", |
|
|
|
|
|
|
|
QRegularExpression::DotMatchesEverythingOption)); |
|
|
|
|
|
|
|
formatted_body.replace("@room", "@\u2060aroom"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RelatedInfo |
|
|
|
RelatedInfo |
|
|
|
stripReplyFallbacks(const TimelineEvent &event, std::string id, QString room_id_); |
|
|
|
stripReplyFallbacks(const TimelineEvent &event, std::string id, QString room_id_); |
|
|
|