Skip to content
Snippets Groups Projects
Verified Commit 298275a9 authored by Nicolas Werner's avatar Nicolas Werner Committed by Joe Donofry
Browse files

Prevent edits from removing quotes at the beginning of a message

parent d59fa42c
No related branches found
No related tags found
No related merge requests found
......@@ -59,11 +59,14 @@ std::string
utils::stripReplyFromBody(const std::string &bodyi)
{
QString body = QString::fromStdString(bodyi);
QRegularExpression plainQuote("^>.*?$\n?", QRegularExpression::MultilineOption);
while (body.startsWith(">"))
body.remove(plainQuote);
if (body.startsWith("\n"))
body.remove(0, 1);
if (body.startsWith("> <")) {
auto segments = body.split('\n');
while (!segments.isEmpty() && segments.begin()->startsWith('>'))
segments.erase(segments.begin());
if (!segments.empty() && segments.first().isEmpty())
segments.erase(segments.begin());
body = segments.join('\n');
}
body.replace("@room", QString::fromUtf8("@\u2060room"));
return body.toStdString();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment