Added interface for highlights to Application (#3808)

This commit is contained in:
Kasia
2022-06-09 16:37:52 +02:00
committed by GitHub
parent 9219647b6a
commit 683701623a
4 changed files with 17 additions and 1 deletions
+6
View File
@@ -2,6 +2,7 @@
#include "BaseSettings.hpp"
#include "common/Channel.hpp"
#include "controllers/accounts/AccountController.hpp"
#include "controllers/highlights/HighlightController.hpp"
#include "controllers/highlights/HighlightPhrase.hpp"
#include "messages/Message.hpp"
#include "messages/SharedMessageBuilder.hpp"
@@ -83,6 +84,10 @@ public:
{
return nullptr;
}
HighlightController *getHighlights() override
{
return &this->highlights;
}
TwitchIrcServer *getTwitch() override
{
return nullptr;
@@ -97,6 +102,7 @@ public:
}
AccountController accounts;
HighlightController highlights;
// TODO: Figure this out
};
+5
View File
@@ -46,6 +46,7 @@ public:
virtual WindowManager *getWindows() = 0;
virtual Toasts *getToasts() = 0;
virtual CommandController *getCommands() = 0;
virtual HighlightController *getHighlights() = 0;
virtual NotificationController *getNotifications() = 0;
virtual TwitchIrcServer *getTwitch() = 0;
virtual ChatterinoBadges *getChatterinoBadges() = 0;
@@ -124,6 +125,10 @@ public:
{
return this->notifications;
}
HighlightController *getHighlights() override
{
return this->highlights;
}
TwitchIrcServer *getTwitch() override
{
return this->twitch;
+1 -1
View File
@@ -155,7 +155,7 @@ void SharedMessageBuilder::parseHighlights()
}
auto badges = SharedMessageBuilder::parseBadgeTag(this->tags);
auto [highlighted, highlightResult] = getApp()->highlights->check(
auto [highlighted, highlightResult] = getIApp()->getHighlights()->check(
this->args, badges, this->ircMessage->nick(), this->originalMessage_);
if (!highlighted)
+5
View File
@@ -54,6 +54,10 @@ public:
{
return nullptr;
}
HighlightController *getHighlights() override
{
return &this->highlights;
}
TwitchIrcServer *getTwitch() override
{
return nullptr;
@@ -68,6 +72,7 @@ public:
}
AccountController accounts;
HighlightController highlights;
// TODO: Figure this out
};