Add highlighting of all messages from a certain user (#564)
* Rework to use controllers * Rework to use controllers * Add doHighlight * Cherry pick? * Fixes per PR * Remove file
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "Application.hpp"
|
||||
#include "controllers/highlights/HighlightBlacklistModel.hpp"
|
||||
#include "controllers/highlights/HighlightModel.hpp"
|
||||
#include "controllers/highlights/UserHighlightModel.hpp"
|
||||
#include "widgets/dialogs/NotificationPopup.hpp"
|
||||
|
||||
namespace chatterino {
|
||||
@@ -33,6 +34,26 @@ HighlightModel *HighlightController::createModel(QObject *parent)
|
||||
return model;
|
||||
}
|
||||
|
||||
UserHighlightModel *HighlightController::createUserModel(QObject *parent)
|
||||
{
|
||||
auto *model = new UserHighlightModel(parent);
|
||||
model->init(&this->highlightedUsers);
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
bool HighlightController::isHighlightedUser(const QString &username)
|
||||
{
|
||||
const auto &userItems = this->highlightedUsers.getVector();
|
||||
for (const auto &highlightedUser : userItems) {
|
||||
if (highlightedUser.isMatch(username)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
HighlightBlacklistModel *HighlightController::createBlacklistModel(QObject *parent)
|
||||
{
|
||||
auto *model = new HighlightBlacklistModel(parent);
|
||||
|
||||
Reference in New Issue
Block a user