mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Added interface for highlights to Application (#3808)
This commit is contained in:
parent
9219647b6a
commit
683701623a
4 changed files with 17 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
||||||
#include "BaseSettings.hpp"
|
#include "BaseSettings.hpp"
|
||||||
#include "common/Channel.hpp"
|
#include "common/Channel.hpp"
|
||||||
#include "controllers/accounts/AccountController.hpp"
|
#include "controllers/accounts/AccountController.hpp"
|
||||||
|
#include "controllers/highlights/HighlightController.hpp"
|
||||||
#include "controllers/highlights/HighlightPhrase.hpp"
|
#include "controllers/highlights/HighlightPhrase.hpp"
|
||||||
#include "messages/Message.hpp"
|
#include "messages/Message.hpp"
|
||||||
#include "messages/SharedMessageBuilder.hpp"
|
#include "messages/SharedMessageBuilder.hpp"
|
||||||
|
@ -83,6 +84,10 @@ public:
|
||||||
{
|
{
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
HighlightController *getHighlights() override
|
||||||
|
{
|
||||||
|
return &this->highlights;
|
||||||
|
}
|
||||||
TwitchIrcServer *getTwitch() override
|
TwitchIrcServer *getTwitch() override
|
||||||
{
|
{
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -97,6 +102,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
AccountController accounts;
|
AccountController accounts;
|
||||||
|
HighlightController highlights;
|
||||||
// TODO: Figure this out
|
// TODO: Figure this out
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,7 @@ public:
|
||||||
virtual WindowManager *getWindows() = 0;
|
virtual WindowManager *getWindows() = 0;
|
||||||
virtual Toasts *getToasts() = 0;
|
virtual Toasts *getToasts() = 0;
|
||||||
virtual CommandController *getCommands() = 0;
|
virtual CommandController *getCommands() = 0;
|
||||||
|
virtual HighlightController *getHighlights() = 0;
|
||||||
virtual NotificationController *getNotifications() = 0;
|
virtual NotificationController *getNotifications() = 0;
|
||||||
virtual TwitchIrcServer *getTwitch() = 0;
|
virtual TwitchIrcServer *getTwitch() = 0;
|
||||||
virtual ChatterinoBadges *getChatterinoBadges() = 0;
|
virtual ChatterinoBadges *getChatterinoBadges() = 0;
|
||||||
|
@ -124,6 +125,10 @@ public:
|
||||||
{
|
{
|
||||||
return this->notifications;
|
return this->notifications;
|
||||||
}
|
}
|
||||||
|
HighlightController *getHighlights() override
|
||||||
|
{
|
||||||
|
return this->highlights;
|
||||||
|
}
|
||||||
TwitchIrcServer *getTwitch() override
|
TwitchIrcServer *getTwitch() override
|
||||||
{
|
{
|
||||||
return this->twitch;
|
return this->twitch;
|
||||||
|
|
|
@ -155,7 +155,7 @@ void SharedMessageBuilder::parseHighlights()
|
||||||
}
|
}
|
||||||
|
|
||||||
auto badges = SharedMessageBuilder::parseBadgeTag(this->tags);
|
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_);
|
this->args, badges, this->ircMessage->nick(), this->originalMessage_);
|
||||||
|
|
||||||
if (!highlighted)
|
if (!highlighted)
|
||||||
|
|
|
@ -54,6 +54,10 @@ public:
|
||||||
{
|
{
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
HighlightController *getHighlights() override
|
||||||
|
{
|
||||||
|
return &this->highlights;
|
||||||
|
}
|
||||||
TwitchIrcServer *getTwitch() override
|
TwitchIrcServer *getTwitch() override
|
||||||
{
|
{
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -68,6 +72,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
AccountController accounts;
|
AccountController accounts;
|
||||||
|
HighlightController highlights;
|
||||||
// TODO: Figure this out
|
// TODO: Figure this out
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue