X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fclient%2Fmessagefilter.h;h=d231030935de84d11dbfad1652f640a34b3fc013;hb=9a77a6c1c6e274103803acce606f445d82456c7c;hp=8f2cc18cda6f0add1894351fe6038a0bb02c017a;hpb=a3aaabf6254c8c5439af8982cc613c4ced3f50ed;p=quassel.git diff --git a/src/client/messagefilter.h b/src/client/messagefilter.h index 8f2cc18c..d2310309 100644 --- a/src/client/messagefilter.h +++ b/src/client/messagefilter.h @@ -23,7 +23,10 @@ #include +#include "bufferinfo.h" +#include "client.h" #include "messagemodel.h" +#include "networkmodel.h" #include "types.h" class MessageFilter : public QSortFilterProxyModel { @@ -38,16 +41,39 @@ public: virtual bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const; virtual QString idString() const; inline bool isSingleBufferFilter() const { return _validBuffers.count() == 1; } + BufferId singleBufferId() const { return *(_validBuffers.constBegin()); } inline bool containsBuffer(const BufferId &id) const { return _validBuffers.contains(id); } + inline QSet containedBuffers() const { return _validBuffers; } public slots: void messageTypeFilterChanged(); + void messageRedirectionChanged(); + void requestBacklog(); + +protected: + QString bufferName() const { return Client::networkModel()->bufferName(singleBufferId()); } + BufferInfo::Type bufferType() const { return Client::networkModel()->bufferType(singleBufferId()); } + NetworkId networkId() const { return Client::networkModel()->networkId(singleBufferId()); } private: void init(); QSet _validBuffers; + mutable QSet _redirectedMsgs; + QMultiHash _filteredQuitMsgs; int _messageTypeFilter; + + bool _userNoticesInDefaultBuffer; + bool _userNoticesInStatusBuffer; + bool _userNoticesInCurrentBuffer; + + bool _serverNoticesInDefaultBuffer; + bool _serverNoticesInStatusBuffer; + bool _serverNoticesInCurrentBuffer; + + bool _errorMsgsInDefaultBuffer; + bool _errorMsgsInStatusBuffer; + bool _errorMsgsInCurrentBuffer; }; #endif