absorbed HighlightController into Application

This commit is contained in:
fourtf
2020-02-23 21:18:40 +01:00
parent d0a81f3fe7
commit f8a9850151
11 changed files with 70 additions and 103 deletions
@@ -1,40 +0,0 @@
#include "HighlightController.hpp"
#include "Application.hpp"
#include "util/PersistSignalVector.hpp"
namespace chatterino {
void HighlightController::initialize(Settings &settings, Paths &paths)
{
assert(!this->initialized_);
this->initialized_ = true;
persist(this->phrases, "/highlighting/highlights");
persist(this->blacklistedUsers, "/highlighting/blacklist");
persist(this->highlightedUsers, "/highlighting/users");
}
bool HighlightController::isHighlightedUser(const QString &username)
{
for (const auto &highlightedUser : this->highlightedUsers)
{
if (highlightedUser.isMatch(username))
return true;
}
return false;
}
bool HighlightController::blacklistContains(const QString &username)
{
for (const auto &blacklistedUser : *this->blacklistedUsers.readOnly())
{
if (blacklistedUser.isMatch(username))
return true;
}
return false;
}
} // namespace chatterino