X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fclient%2Fclientignorelistmanager.h;h=eb1f807be85a6cd9677db32a959d90ca813e9da7;hb=d46e1e86c9869996285ac3f88970cf0e9e23e128;hp=61a9c49a42e9d29e53a210ad484fc22ae8fd71b9;hpb=12feae2e4609b90c87d3c1857031909248143fd7;p=quassel.git diff --git a/src/client/clientignorelistmanager.h b/src/client/clientignorelistmanager.h index 61a9c49a..eb1f807b 100644 --- a/src/client/clientignorelistmanager.h +++ b/src/client/clientignorelistmanager.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-09 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 * @@ -15,28 +15,36 @@ * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef CLIENTIGNORELISTMANAGER_H -#define CLIENTIGNORELISTMANAGER_H +#pragma once + +#include "client-export.h" + +#include #include "ignorelistmanager.h" -class ClientIgnoreListManager : public IgnoreListManager +class CLIENT_EXPORT ClientIgnoreListManager : public IgnoreListManager { - SYNCABLE_OBJECT - Q_OBJECT + Q_OBJECT public: - explicit ClientIgnoreListManager(QObject *parent = 0); - inline virtual const QMetaObject *syncMetaObject() const { return &IgnoreListManager::staticMetaObject; } + explicit ClientIgnoreListManager(QObject* parent = nullptr); + + //! Fetch all matching ignore rules for a given hostmask + /** \param hostmask The hostmask of the user + * \param network The network name + * \param channel The channel name + * \return Returns a QMap with the rule as key and a bool, representing if the rule is enabled or not, as value + */ + QMap matchingRulesForHostmask(const QString& hostmask, const QString& network, const QString& channel) const; signals: - void ignoreListChanged(); + void ignoreListChanged(); -private slots: - void ignoreListUpdated(const QVariantMap &newMap); +private: + // matches an ignore rule against a given string + bool pureMatch(const IgnoreListItem& item, const QString& string) const; }; - -#endif // CLIENTIGNORELISTMANAGER_H