+
+bool IgnoreListManager::ctcpMatch(const QString sender, const QString &network, const QString &type)
+{
+ foreach(IgnoreListItem item, _ignoreList) {
+ if (!item.isEnabled())
+ continue;
+ if (item.scope() == GlobalScope
+ || (item.scope() == NetworkScope && item.scopeRuleMatcher().match(network))) {
+
+ // For CTCP ignore rules, use ctcpSender
+ if (item.senderCTCPMatcher().match(sender)) {
+ // Sender matches, check types
+ if (item.ctcpTypes().isEmpty()
+ || item.ctcpTypes().contains(type, Qt::CaseInsensitive)) {
+ // Either all types are blocked, or type matches
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+}
+
+
+/**************************************************************************
+ * IgnoreListItem
+ *************************************************************************/
+bool IgnoreListManager::IgnoreListItem::operator!=(const IgnoreListItem &other) const
+{
+ return (_type != other._type ||
+ _contents != other._contents ||
+ _isRegEx != other._isRegEx ||
+ _strictness != other._strictness ||
+ _scope != other._scope ||
+ _scopeRule != other._scopeRule ||
+ _isEnabled != other._isEnabled);
+ // Don't compare ExpressionMatch objects as they are created as needed from the above