@@ -1,6 +1,7 @@
|
||||
#include "HighlightController.hpp"
|
||||
|
||||
#include "Application.hpp"
|
||||
#include "controllers/highlights/HighlightBlacklistModel.hpp"
|
||||
#include "controllers/highlights/HighlightModel.hpp"
|
||||
#include "widgets/dialogs/NotificationPopup.hpp"
|
||||
|
||||
@@ -32,6 +33,26 @@ HighlightModel *HighlightController::createModel(QObject *parent)
|
||||
return model;
|
||||
}
|
||||
|
||||
HighlightBlacklistModel *HighlightController::createBlacklistModel(QObject *parent)
|
||||
{
|
||||
auto *model = new HighlightBlacklistModel(parent);
|
||||
model->init(&this->blacklistedUsers);
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
bool HighlightController::blacklistContains(const QString &username)
|
||||
{
|
||||
std::vector<HighlightBlacklistUser> blacklistItems = this->blacklistedUsers.getVector();
|
||||
for (const auto &blacklistedUser : blacklistItems) {
|
||||
if (blacklistedUser.isMatch(username)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void HighlightController::addHighlight(const MessagePtr &msg)
|
||||
{
|
||||
// static NotificationPopup popup;
|
||||
|
||||
Reference in New Issue
Block a user