summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/Controllers/HighlightRule.cpp')
-rw-r--r--Swift/Controllers/HighlightRule.cpp38
1 files changed, 37 insertions, 1 deletions
diff --git a/Swift/Controllers/HighlightRule.cpp b/Swift/Controllers/HighlightRule.cpp
index f1a7cef..40b7560 100644
--- a/Swift/Controllers/HighlightRule.cpp
+++ b/Swift/Controllers/HighlightRule.cpp
@@ -2,13 +2,13 @@
* Copyright (c) 2012 Maciej Niedzielski
* Licensed under the simplified BSD license.
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
/*
- * Copyright (c) 2014 Isode Limited.
+ * Copyright (c) 2014-2015 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <algorithm>
#include <boost/algorithm/string.hpp>
@@ -146,7 +146,43 @@ void HighlightRule::setMatchMUC(bool matchMUC)
bool HighlightRule::isEmpty() const
{
return senders_.empty() && keywords_.empty() && !nickIsKeyword_ && !matchChat_ && !matchMUC_ && action_.isEmpty();
}
+bool operator ==(HighlightRule const& a, HighlightRule const& b) {
+ if (a.getSenders() != b.getSenders()) {
+ return false;
+ }
+
+ if (a.getKeywords() != b.getKeywords()) {
+ return false;
+ }
+
+ if (a.getNickIsKeyword() != b.getNickIsKeyword()) {
+ return false;
+ }
+
+ if (a.getMatchChat() != b.getMatchChat()) {
+ return false;
+ }
+
+ if (a.getMatchMUC() != b.getMatchMUC()) {
+ return false;
+ }
+
+ if (a.getMatchCase() != b.getMatchCase()) {
+ return false;
+ }
+
+ if (a.getMatchWholeWords() != b.getMatchWholeWords()) {
+ return false;
+ }
+
+ if (a.getAction() != b.getAction()) {
+ return false;
+ }
+
+ return true;
+}
+
}