diff options
author | Richard Maudsley <richard.maudsley@isode.com> | 2014-01-22 15:32:20 (GMT) |
---|---|---|
committer | Richard Maudsley <richard.maudsley@isode.com> | 2014-01-22 15:32:20 (GMT) |
commit | 4f45b7e104b8cae4f07daf9b2bd5ea2012609f63 (patch) | |
tree | 834bad28eef0f800221437e4f7c72a241bd29c29 /Swift/Controllers/HighlightRule.cpp | |
parent | 55b9f6759ab637e9365693b3b34f04ecc211608d (diff) | |
download | swift-4f45b7e104b8cae4f07daf9b2bd5ea2012609f63.zip swift-4f45b7e104b8cae4f07daf9b2bd5ea2012609f63.tar.bz2 |
Fixed unit tests.
Change-Id: I79fc2d143de40fd4ac3a0f5be417e25a434c3143
Diffstat (limited to 'Swift/Controllers/HighlightRule.cpp')
-rw-r--r-- | Swift/Controllers/HighlightRule.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Swift/Controllers/HighlightRule.cpp b/Swift/Controllers/HighlightRule.cpp index 622fbad..cc20401 100644 --- a/Swift/Controllers/HighlightRule.cpp +++ b/Swift/Controllers/HighlightRule.cpp @@ -63,20 +63,20 @@ bool HighlightRule::isMatch(const std::string& body, const std::string& sender, bool matchesKeyword = keywords_.empty() && (nick.empty() || !nickIsKeyword_); bool matchesSender = senders_.empty(); - foreach (const boost::regex & rx, keywordRegex_) { - if (boost::regex_search(body, rx)) { - matchesKeyword = true; - break; - } - } - /* keyword highlighting has now moved to ChatMessageParser.cpp */ - //if (!matchesKeyword && nickIsKeyword_ && !nick.empty()) { - //if (boost::regex_search(body, regexFromString(nick))) { + //foreach (const boost::regex & rx, keywordRegex_) { + //if (boost::regex_search(body, rx)) { //matchesKeyword = true; + //break; //} //} + if (!matchesKeyword && nickIsKeyword_ && !nick.empty()) { + if (boost::regex_search(body, regexFromString(nick))) { + matchesKeyword = true; + } + } + foreach (const boost::regex & rx, senderRegex_) { if (boost::regex_search(sender, rx)) { matchesSender = true; |