diff --git a/benchmarks/src/Highlights.cpp b/benchmarks/src/Highlights.cpp index 82234f5c3..e87a38bac 100644 --- a/benchmarks/src/Highlights.cpp +++ b/benchmarks/src/Highlights.cpp @@ -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 }; diff --git a/src/Application.hpp b/src/Application.hpp index 2260dbe28..ee0d1417c 100644 --- a/src/Application.hpp +++ b/src/Application.hpp @@ -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; diff --git a/src/messages/SharedMessageBuilder.cpp b/src/messages/SharedMessageBuilder.cpp index 2f96e8571..2dae93669 100644 --- a/src/messages/SharedMessageBuilder.cpp +++ b/src/messages/SharedMessageBuilder.cpp @@ -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) diff --git a/tests/src/HighlightController.cpp b/tests/src/HighlightController.cpp index c2a60dc5f..8e4a05ebb 100644 --- a/tests/src/HighlightController.cpp +++ b/tests/src/HighlightController.cpp @@ -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 };