X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fclient%2Fclientignorelistmanager.cpp;h=5ea2d04d290c2b39296fc3038bff5401a8f543d1;hb=a8ab790b2218d6131f12b622b1373ba62958f3ef;hp=a23f8917a1d82ad849be70003b41429f0338d69e;hpb=fcacaaf16551524c7ebb6114254d005274cc3d63;p=quassel.git diff --git a/src/client/clientignorelistmanager.cpp b/src/client/clientignorelistmanager.cpp index a23f8917..5ea2d04d 100644 --- a/src/client/clientignorelistmanager.cpp +++ b/src/client/clientignorelistmanager.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2018 by the Quassel Project * + * Copyright (C) 2005-2019 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -20,26 +20,25 @@ #include "clientignorelistmanager.h" -ClientIgnoreListManager::ClientIgnoreListManager(QObject *parent) +ClientIgnoreListManager::ClientIgnoreListManager(QObject* parent) : IgnoreListManager(parent) { connect(this, &SyncableObject::updatedRemotely, this, &ClientIgnoreListManager::ignoreListChanged); } - -bool ClientIgnoreListManager::pureMatch(const IgnoreListItem &item, const QString &string) const +bool ClientIgnoreListManager::pureMatch(const IgnoreListItem& item, const QString& string) const { return (item.contentsMatcher().match(string)); } - -QMap ClientIgnoreListManager::matchingRulesForHostmask(const QString &hostmask, const QString &network, const QString &channel) const +QMap ClientIgnoreListManager::matchingRulesForHostmask(const QString& hostmask, + const QString& network, + const QString& channel) const { QMap result; - foreach(IgnoreListItem item, ignoreList()) { + foreach (IgnoreListItem item, ignoreList()) { if (item.type() == SenderIgnore && pureMatch(item, hostmask) - && ((network.isEmpty() && channel.isEmpty()) - || item.scope() == GlobalScope + && ((network.isEmpty() && channel.isEmpty()) || item.scope() == GlobalScope || (item.scope() == NetworkScope && item.scopeRuleMatcher().match(network)) || (item.scope() == ChannelScope && item.scopeRuleMatcher().match(channel)))) { result[item.contents()] = item.isEnabled();