diff options
Diffstat (limited to 'Swift/Controllers/Highlighter.cpp')
-rw-r--r-- | Swift/Controllers/Highlighter.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Swift/Controllers/Highlighter.cpp b/Swift/Controllers/Highlighter.cpp index 754641a..efeeb6b 100644 --- a/Swift/Controllers/Highlighter.cpp +++ b/Swift/Controllers/Highlighter.cpp @@ -5,4 +5,10 @@ */ +/* + * Copyright (c) 2014 Kevin Smith and Remko Tronçon + * Licensed under the GNU General Public License v3. + * See Documentation/Licenses/GPLv3.txt for more information. + */ + #include <Swiften/Base/foreach.h> #include <Swift/Controllers/Highlighter.h> @@ -25,7 +31,9 @@ void Highlighter::setMode(Mode mode) HighlightAction Highlighter::findAction(const std::string& body, const std::string& sender) const { - foreach (const HighlightRule & r, manager_->getRules()) { - if (r.isMatch(body, sender, nick_, messageType_)) { - return r.getAction(); + HighlightRulesListPtr rules = manager_->getRules(); + for (size_t i = 0; i < rules->getSize(); ++i) { + const HighlightRule& rule = rules->getRule(i); + if (rule.isMatch(body, sender, nick_, messageType_)) { + return rule.getAction(); } } |