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 an SubtierPredicate with a list of subtiers to search for.
*
* @param subtiers a list of subtiers that a message should contain
* @param subtiers one or more comma-separated subtiers that the message should contain
* @param negate when set, excludes messages containing selected subtiers from results
*/
SubtierPredicate(const QStringList &subtiers);
SubtierPredicate(const QString &subtiers, bool negate);
protected:
/**
* @brief Checks whether the message contains any of the subtiers passed
* in the constructor.
@@ -28,7 +30,7 @@ public:
* @return true if the message contains a subtier listed in the specified subtiers,
* false otherwise
*/
bool appliesTo(const Message &message) override;
bool appliesToImpl(const Message &message) override;
private:
/// Holds the subtiers that will be searched for