X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcommon%2Fignorelistmanager.h;h=b5bdf227a69d711f480e488cd26d315e5197e486;hb=dfcf836c5f1f57cadcdbea5c5a7a7034d21ce332;hp=d6ab6eca973fbb0c1bcbef014a90b226963552c5;hpb=f19fea582ace1d8f3dfe29c1096c48758079e56e;p=quassel.git diff --git a/src/common/ignorelistmanager.h b/src/common/ignorelistmanager.h index d6ab6eca..b5bdf227 100644 --- a/src/common/ignorelistmanager.h +++ b/src/common/ignorelistmanager.h @@ -23,10 +23,9 @@ #include +#include "message.h" #include "syncableobject.h" -class Message; - class IgnoreListManager : public SyncableObject { SYNCABLE_OBJECT @@ -37,7 +36,8 @@ public: enum IgnoreType { SenderIgnore, - MessageIgnore + MessageIgnore, + CtcpIgnore }; enum StrictnessType { @@ -91,8 +91,9 @@ public: * \param network The networkname the message belongs to * \return UnmatchedStrictness, HardStrictness or SoftStrictness representing the match type */ - StrictnessType match(const Message &msg, const QString &network = QString()); + inline StrictnessType match(const Message &msg, const QString &network = QString()) { return _match(msg.contents(), msg.sender(), msg.type(), network, msg.bufferInfo().bufferName()); } + bool ctcpMatch(const QString sender, const QString &network, const QString &type = QString()); // virtual void addIgnoreListItem(const IgnoreListItem &item); @@ -135,8 +136,10 @@ public slots: protected: void setIgnoreList(const QList &ignoreList) { _ignoreList = ignoreList; } - // scopeRule is a ; separated list, string is a network/channel-name - bool scopeMatch(const QString &scopeRule, const QString &string) const; + bool scopeMatch(const QString &scopeRule, const QString &string) const; // scopeRule is a ';'-separated list, string is a network/channel-name + + StrictnessType _match(const QString &msgContents, const QString &msgSender, Message::Type msgType, const QString &network, const QString &bufferName); + signals: void ignoreAdded(IgnoreType type, const QString &ignoreRule, bool isRegex, StrictnessType strictness, ScopeType scope, const QVariant &scopeRule, bool isActive);