feat: Allow negation of search predicates (#4207)

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
closes https://github.com/Chatterino/chatterino2/issues/3998
This commit is contained in:
kornes
2022-12-04 11:34:13 +00:00
committed by GitHub
parent 4fa214a38a
commit b7888749fe
19 changed files with 139 additions and 111 deletions
+5 -3
View File
@@ -16,10 +16,12 @@ public:
/**
* @brief Create a ChannelPredicate with a list of channels to search for.
*
* @param channels a list of channel names that a message should be sent in
* @param channels one or more comma-separated channel names that a message should be sent in
* @param negate when set, excludes list of channel names from results
*/
ChannelPredicate(const QStringList &channels);
ChannelPredicate(const QString &channels, bool negate);
protected:
/**
* @brief Checks whether the message was sent in any of the channels passed
* in the constructor.
@@ -28,7 +30,7 @@ public:
* @return true if the message was sent in one of the specified channels,
* false otherwise
*/
bool appliesTo(const Message &message);
bool appliesToImpl(const Message &message) override;
private:
/// Holds the channel names that will be searched for