summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-02-11 18:55:09 (GMT)
committerTobias Markmann <tm@ayena.de>2015-02-11 19:46:31 (GMT)
commitdf2ad14297e264365c37435cf64672ea3920ea10 (patch)
tree64d2cd00bd0ffd4f8f7eef16ea23cc1d220e9db7 /Swift/Controllers/Chat/ChatMessageParser.cpp
parentce0e55e031c634b5e16520b22ea241775a159124 (diff)
downloadswift-df2ad14297e264365c37435cf64672ea3920ea10.zip
swift-df2ad14297e264365c37435cf64672ea3920ea10.tar.bz2
Do not try highlight words if no text and background colours are specified
The tests have been adjusted so a colour is set in their highlight actions. Test-Information: Tested with a "own nick" highlight rule with a "No highlight" action and one with highlights colours set. The cases now work as expected. Added a unit test that checks that no highlighting happens when no colour is specified. Change-Id: Ied48d8c2e033531c1b0532348b9380e1bd884b44
Diffstat (limited to 'Swift/Controllers/Chat/ChatMessageParser.cpp')
-rw-r--r--Swift/Controllers/Chat/ChatMessageParser.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/Swift/Controllers/Chat/ChatMessageParser.cpp b/Swift/Controllers/Chat/ChatMessageParser.cpp
index fe61724..666ec2f 100644
--- a/Swift/Controllers/Chat/ChatMessageParser.cpp
+++ b/Swift/Controllers/Chat/ChatMessageParser.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2014 Isode Limited.
+ * Copyright (c) 2013-2015 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -148,6 +148,8 @@ namespace Swift {
continue; /* this rule only applies to MUC's, and this is a CHAT */
} else if (rule.getMatchChat() && mucMode_) {
continue; /* this rule only applies to CHAT's, and this is a MUC */
+ } else if (rule.getAction().getTextBackground().empty() && rule.getAction().getTextColor().empty()) {
+ continue; /* do not try to highlight text, if no highlight color is specified */
}
const std::vector<boost::regex> keywordRegex = rule.getKeywordRegex(nick);
foreach(const boost::regex& regex, keywordRegex) {