summaryrefslogtreecommitdiff
path: root/MessageFilter.cpp
blob: 2ed260a740c7c2a0138edcf9141c441ac0bf74d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "MessageFilter.hpp"

bool MessageFilter::containsAny(const QString& text, const QStringList& keywords)
{
    for (const QString& keyword : keywords) {
        if (!keyword.isEmpty() && text.contains(keyword)) {
            return true;
        }
    }
    return false;
}

bool MessageFilter::startsWithAny(const QString& text, const QStringList& keywords)
{
    for (const QString& keyword : keywords) {
        if (!keyword.isEmpty() && text.startsWith(keyword)) {
            return true;
        }
    }
    return false;
}