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
+14
View File
@@ -10,6 +10,7 @@
#include <unordered_set>
#include "common/FlagsEnum.hpp"
#include "controllers/filters/FilterSet.hpp"
#include "messages/Image.hpp"
#include "messages/LimitedQueue.hpp"
#include "messages/LimitedQueueSnapshot.hpp"
@@ -76,6 +77,10 @@ public:
ChannelPtr channel();
void setChannel(ChannelPtr channel_);
void setFilters(const QList<QUuid> &ids);
const QList<QUuid> getFilterIds() const;
FilterSetPtr getFilterSet() const;
ChannelPtr sourceChannel() const;
void setSourceChannel(ChannelPtr sourceChannel);
bool hasSourceChannel() const;
@@ -178,11 +183,20 @@ private:
LimitedQueueSnapshot<MessageLayoutPtr> snapshot_;
ChannelPtr channel_;
ChannelPtr underlyingChannel_;
ChannelPtr sourceChannel_;
Scrollbar *scrollBar_;
EffectLabel *goToBottom_;
FilterSetPtr channelFilters_;
// Returns true if message should be included
bool shouldIncludeMessage(const MessagePtr &m) const;
// Returns whether the scrollbar should have highlights
bool showScrollbarHighlights() const;
// This variable can be used to decide whether or not we should render the
// "Show latest messages" button
bool showingLatestMessages_ = true;