1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

chatmessage.cpp: detectQuotes() simplify conditional statement

This commit is contained in:
Ansa89 2015-05-24 17:16:30 +02:00
parent a32609230f
commit 264732bf10

View File

@ -212,11 +212,9 @@ QString ChatMessage::detectQuotes(const QString& str, MessageType type)
// quotes and action messages possible, since only first line can cause
// problems in case where there is quote in it used.
if (QRegExp("^(>|)( |[[]|>|[^_\\d\\W]).*").exactMatch(messageLines[i])) {
if (type != ACTION)
if (i > 0 || type != ACTION)
quotedText += "<span class=quote>" + messageLines[i] + "</span>";
else if (type == ACTION && i > 0)
quotedText += "<span class=quote>" + messageLines[i] + "</span>";
else if (type == ACTION && i == 0)
else
quotedText += messageLines[i];
} else {
quotedText += messageLines[i];