Files
chatterino2/src/messages/search/ChannelPredicate.cpp
2021-04-17 11:18:22 +00:00

24 lines
586 B
C++

#include "messages/search/ChannelPredicate.hpp"
namespace chatterino {
ChannelPredicate::ChannelPredicate(const QStringList &channels)
: channels_()
{
// Check if any comma-seperated values were passed and transform those
for (const auto &entry : channels)
{
for (const auto &channel : entry.split(',', QString::SkipEmptyParts))
{
this->channels_ << channel;
}
}
}
bool ChannelPredicate::appliesTo(const Message &message)
{
return channels_.contains(message.channelName, Qt::CaseInsensitive);
}
} // namespace chatterino