diff options
Diffstat (limited to 'Swift/QtUI/QtWebKitChatView.cpp')
-rw-r--r-- | Swift/QtUI/QtWebKitChatView.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Swift/QtUI/QtWebKitChatView.cpp b/Swift/QtUI/QtWebKitChatView.cpp index f1278b8..7e0e505 100644 --- a/Swift/QtUI/QtWebKitChatView.cpp +++ b/Swift/QtUI/QtWebKitChatView.cpp | |||
@@ -621,12 +621,14 @@ std::string QtWebKitChatView::addMessage( | |||
621 | htmlString += QString("%1</span> ").arg(QtUtilities::htmlEscape(P2QSTRING(label->getDisplayMarking()))); | 621 | htmlString += QString("%1</span> ").arg(QtUtilities::htmlEscape(P2QSTRING(label->getDisplayMarking()))); |
622 | } | 622 | } |
623 | 623 | ||
624 | QString styleSpanStart = style == "" ? "" : "<span style=\"" + style + "\">"; | 624 | QString styleSpanStart = style == "" ? "" : "<span style=\"" + style + "\">"; |
625 | QString styleSpanEnd = style == "" ? "" : "</span>"; | 625 | QString styleSpanEnd = style == "" ? "" : "</span>"; |
626 | QString highlightSpanStart = highlight.highlightAllText() ? getHighlightSpanStart(highlight) : ""; | 626 | |
627 | QString highlightSpanEnd = highlight.highlightAllText() ? "</span>" : ""; | 627 | bool highlightWholeMessage = highlight.highlightWholeMessage() && highlight.getTextBackground() != "" && highlight.getTextColor() != ""; |
628 | QString highlightSpanStart = highlightWholeMessage ? getHighlightSpanStart(highlight) : ""; | ||
629 | QString highlightSpanEnd = highlightWholeMessage ? "</span>" : ""; | ||
628 | htmlString += "<span class='swift_inner_message'>" + styleSpanStart + highlightSpanStart + message + highlightSpanEnd + styleSpanEnd + "</span>" ; | 630 | htmlString += "<span class='swift_inner_message'>" + styleSpanStart + highlightSpanStart + message + highlightSpanEnd + styleSpanEnd + "</span>" ; |
629 | 631 | ||
630 | bool appendToPrevious = appendToPreviousCheck(PreviousMessageWasMessage, senderName, senderIsSelf); | 632 | bool appendToPrevious = appendToPreviousCheck(PreviousMessageWasMessage, senderName, senderIsSelf); |
631 | 633 | ||
632 | QString qAvatarPath = scaledAvatarPath.isEmpty() ? "qrc:/icons/avatar.png" : QUrl::fromLocalFile(scaledAvatarPath).toEncoded(); | 634 | QString qAvatarPath = scaledAvatarPath.isEmpty() ? "qrc:/icons/avatar.png" : QUrl::fromLocalFile(scaledAvatarPath).toEncoded(); |
@@ -869,12 +871,12 @@ void QtWebKitChatView::replaceMessage(const QString& message, const std::string& | |||
869 | 871 | ||
870 | QString messageHTML(message); | 872 | QString messageHTML(message); |
871 | 873 | ||
872 | QString styleSpanStart = style == "" ? "" : "<span style=\"" + style + "\">"; | 874 | QString styleSpanStart = style == "" ? "" : "<span style=\"" + style + "\">"; |
873 | QString styleSpanEnd = style == "" ? "" : "</span>"; | 875 | QString styleSpanEnd = style == "" ? "" : "</span>"; |
874 | QString highlightSpanStart = highlight.highlightAllText() ? getHighlightSpanStart(highlight) : ""; | 876 | QString highlightSpanStart = highlight.highlightWholeMessage() ? getHighlightSpanStart(highlight) : ""; |
875 | QString highlightSpanEnd = highlight.highlightAllText() ? "</span>" : ""; | 877 | QString highlightSpanEnd = highlight.highlightWholeMessage() ? "</span>" : ""; |
876 | messageHTML = styleSpanStart + highlightSpanStart + messageHTML + highlightSpanEnd + styleSpanEnd; | 878 | messageHTML = styleSpanStart + highlightSpanStart + messageHTML + highlightSpanEnd + styleSpanEnd; |
877 | 879 | ||
878 | replaceMessage(messageHTML, P2QSTRING(id), B2QDATE(time)); | 880 | replaceMessage(messageHTML, P2QSTRING(id), B2QDATE(time)); |
879 | } | 881 | } |
880 | else { | 882 | else { |