Advanced channel filters (#1748)

Adds custom channel filters complete with their own mini-language. Filters can be created in settings, and applied by clicking the three dots to open the Split menu and selecting "Set filters".
This commit is contained in:
dnsge
2020-10-18 15:16:56 +02:00
committed by Rasmus Karlsson
parent 812cbdf4f9
commit 4199a01b96
41 changed files with 2189 additions and 43 deletions
+6 -1
View File
@@ -1,6 +1,7 @@
#pragma once
#include "ForwardDecl.hpp"
#include "controllers/filters/FilterSet.hpp"
#include "messages/LimitedQueueSnapshot.hpp"
#include "messages/search/MessagePredicate.hpp"
#include "widgets/BasePopup.hpp"
@@ -17,6 +18,7 @@ public:
SearchPopup();
virtual void setChannel(const ChannelPtr &channel);
virtual void setChannelFilters(FilterSetPtr filters);
protected:
virtual void updateWindowTitle();
@@ -32,12 +34,14 @@ private:
* @param text the search query -- will be parsed for MessagePredicates
* @param channelName name of the channel to be returned
* @param snapshot list of messages to filter
* @param filterSet channel filter to apply
*
* @return a ChannelPtr with "channelName" and the filtered messages from
* "snapshot"
*/
static ChannelPtr filter(const QString &text, const QString &channelName,
const LimitedQueueSnapshot<MessagePtr> &snapshot);
const LimitedQueueSnapshot<MessagePtr> &snapshot,
FilterSetPtr filterSet);
/**
* @brief Checks the input for tags and registers their corresponding
@@ -53,6 +57,7 @@ private:
QLineEdit *searchInput_{};
ChannelView *channelView_{};
QString channelName_{};
FilterSetPtr channelFilters_;
};
} // namespace chatterino