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