refactor: turn Emotes into EmoteController (#6516)

* refactor: turn `Emotes` into `EmoteController`

* changelog

* why does clang-format do this???

* nit: remove unused include from EmoteController.hpp

---------

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
nerix
2025-10-04 12:05:27 +02:00
committed by GitHub
parent 2bf617f37a
commit c5b0669812
33 changed files with 158 additions and 154 deletions
+1
View File
@@ -16,6 +16,7 @@
- Dev: Removed dependency to Qt5 Compatibility module by updating libcommuni. (#6500)
- Dev: Merged emote element flags from different providers into two. (#6511)
- Dev: Removed unused method in `Emojis`. (#6517)
- Dev: Refactored `Emotes` into `EmoteController`. (#6516)
## 2.5.4
+3 -3
View File
@@ -4,7 +4,7 @@
#include "messages/Emote.hpp"
#include "mocks/BaseApplication.hpp"
#include "mocks/DisabledStreamerMode.hpp"
#include "mocks/Emotes.hpp"
#include "mocks/EmoteController.hpp"
#include "mocks/LinkResolver.hpp"
#include "mocks/Logging.hpp"
#include "mocks/TwitchIrcServer.hpp"
@@ -41,7 +41,7 @@ public:
{
}
IEmotes *getEmotes() override
EmoteController *getEmotes() override
{
return &this->emotes;
}
@@ -118,7 +118,7 @@ public:
mock::EmptyLogging logging;
AccountController accounts;
mock::Emotes emotes;
mock::EmoteController emotes;
mock::UserDataController userData;
mock::MockTwitchIrcServer twitch;
mock::EmptyLinkResolver linkResolver;
+21
View File
@@ -0,0 +1,21 @@
#pragma once
#include "controllers/emotes/EmoteController.hpp"
#include "providers/emoji/Emojis.hpp"
namespace chatterino::mock {
class EmoteController : public chatterino::EmoteController
{
public:
EmoteController()
{
this->getEmojis()->load();
}
void initialize() override
{
}
};
} // namespace chatterino::mock
-38
View File
@@ -1,38 +0,0 @@
#pragma once
#include "singletons/Emotes.hpp"
namespace chatterino::mock {
class Emotes : public IEmotes
{
public:
Emotes()
{
this->emojis.load();
// don't initialize GIFTimer
}
ITwitchEmotes *getTwitchEmotes() override
{
return &this->twitch;
}
IEmojis *getEmojis() override
{
return &this->emojis;
}
GIFTimer &getGIFTimer() override
{
return this->gifTimer;
}
private:
TwitchEmotes twitch;
Emojis emojis;
GIFTimer gifTimer;
};
} // namespace chatterino::mock
+1 -1
View File
@@ -56,7 +56,7 @@ public:
return nullptr;
}
IEmotes *getEmotes() override
EmoteController *getEmotes() override
{
assert(
false &&
+4 -3
View File
@@ -24,6 +24,7 @@
#ifdef CHATTERINO_HAVE_PLUGINS
# include "controllers/plugins/PluginController.hpp"
#endif
#include "controllers/emotes/EmoteController.hpp"
#include "controllers/sound/MiniaudioBackend.hpp"
#include "controllers/sound/NullBackend.hpp"
#include "controllers/twitch/LiveController.hpp"
@@ -43,7 +44,6 @@
#include "providers/twitch/TwitchIrcServer.hpp"
#include "providers/twitch/TwitchUsers.hpp"
#include "singletons/CrashHandler.hpp"
#include "singletons/Emotes.hpp"
#include "singletons/Fonts.hpp"
#include "singletons/helper/LoggingChannel.hpp"
#include "singletons/Logging.hpp"
@@ -163,7 +163,7 @@ Application::Application(Settings &_settings, const Paths &paths,
, themes(new Theme(paths))
, fonts(new Fonts(_settings))
, logging(new Logging(_settings))
, emotes(new Emotes)
, emotes(new EmoteController)
, accounts(new AccountController)
, eventSub(makeEventSubController(_settings))
, hotkeys(new HotkeyController)
@@ -233,6 +233,7 @@ void Application::initialize(Settings &settings, const Paths &paths)
{
getSettings()->currentVersion.setValue(CHATTERINO_VERSION);
}
this->emotes->initialize();
this->accounts->load();
@@ -343,7 +344,7 @@ Fonts *Application::getFonts()
return this->fonts.get();
}
IEmotes *Application::getEmotes()
EmoteController *Application::getEmotes()
{
assertInGuiThread();
assert(this->emotes);
+4 -5
View File
@@ -32,8 +32,7 @@ class WindowManager;
class ILogging;
class Logging;
class Paths;
class Emotes;
class IEmotes;
class EmoteController;
class Settings;
class Fonts;
class Toasts;
@@ -77,7 +76,7 @@ public:
virtual const Args &getArgs() = 0;
virtual Theme *getThemes() = 0;
virtual Fonts *getFonts() = 0;
virtual IEmotes *getEmotes() = 0;
virtual EmoteController *getEmotes() = 0;
virtual AccountController *getAccounts() = 0;
virtual HotkeyController *getHotkeys() = 0;
virtual WindowManager *getWindows() = 0;
@@ -149,7 +148,7 @@ private:
std::unique_ptr<Theme> themes;
std::unique_ptr<Fonts> fonts;
std::unique_ptr<Logging> logging;
std::unique_ptr<Emotes> emotes;
std::unique_ptr<EmoteController> emotes;
std::unique_ptr<AccountController> accounts;
std::unique_ptr<eventsub::IController> eventSub;
std::unique_ptr<HotkeyController> hotkeys;
@@ -194,7 +193,7 @@ public:
}
Theme *getThemes() override;
Fonts *getFonts() override;
IEmotes *getEmotes() override;
EmoteController *getEmotes() override;
AccountController *getAccounts() override;
HotkeyController *getHotkeys() override;
WindowManager *getWindows() override;
+3 -2
View File
@@ -158,6 +158,9 @@ set(SOURCE_FILES
controllers/completion/TabCompletionModel.cpp
controllers/completion/TabCompletionModel.hpp
controllers/emotes/EmoteController.cpp
controllers/emotes/EmoteController.hpp
controllers/filters/FilterModel.cpp
controllers/filters/FilterModel.hpp
controllers/filters/FilterRecord.cpp
@@ -473,8 +476,6 @@ set(SOURCE_FILES
singletons/CrashHandler.cpp
singletons/CrashHandler.hpp
singletons/Emotes.cpp
singletons/Emotes.hpp
singletons/Fonts.cpp
singletons/Fonts.hpp
singletons/ImageUploader.cpp
@@ -30,13 +30,14 @@
#include "controllers/commands/Command.hpp"
#include "controllers/commands/CommandContext.hpp"
#include "controllers/commands/CommandModel.hpp"
#include "controllers/emotes/EmoteController.hpp"
#include "controllers/plugins/PluginController.hpp"
#include "messages/Message.hpp"
#include "messages/MessageBuilder.hpp"
#include "providers/emoji/Emojis.hpp"
#include "providers/twitch/TwitchAccount.hpp"
#include "providers/twitch/TwitchChannel.hpp"
#include "providers/twitch/TwitchCommon.hpp"
#include "singletons/Emotes.hpp"
#include "singletons/Paths.hpp"
#include "util/CombinePath.hpp"
#include "util/QStringHash.hpp"
@@ -4,15 +4,16 @@
#include "common/LinkParser.hpp"
#include "controllers/accounts/AccountController.hpp"
#include "controllers/commands/CommandContext.hpp"
#include "controllers/emotes/EmoteController.hpp"
#include "messages/Message.hpp"
#include "messages/MessageBuilder.hpp"
#include "messages/MessageElement.hpp"
#include "providers/bttv/BttvEmotes.hpp"
#include "providers/emoji/Emojis.hpp"
#include "providers/ffz/FfzEmotes.hpp"
#include "providers/twitch/api/Helix.hpp"
#include "providers/twitch/TwitchAccount.hpp"
#include "providers/twitch/TwitchIrcServer.hpp"
#include "singletons/Emotes.hpp"
#include "singletons/Settings.hpp"
#include "singletons/StreamerMode.hpp"
#include "singletons/Theme.hpp"
@@ -3,6 +3,7 @@
#include "Application.hpp"
#include "controllers/accounts/AccountController.hpp"
#include "controllers/completion/sources/Helpers.hpp"
#include "controllers/emotes/EmoteController.hpp"
#include "providers/bttv/BttvEmotes.hpp"
#include "providers/emoji/Emojis.hpp"
#include "providers/ffz/FfzEmotes.hpp"
@@ -10,7 +11,6 @@
#include "providers/twitch/TwitchAccount.hpp"
#include "providers/twitch/TwitchChannel.hpp"
#include "providers/twitch/TwitchIrcServer.hpp"
#include "singletons/Emotes.hpp"
#include "widgets/splits/InputCompletionItem.hpp"
namespace chatterino::completion {
@@ -0,0 +1,38 @@
#include "controllers/emotes/EmoteController.hpp"
#include "providers/emoji/Emojis.hpp"
#include "providers/twitch/TwitchEmotes.hpp"
#include "singletons/helper/GifTimer.hpp"
namespace chatterino {
EmoteController::EmoteController()
: twitchEmotes_(std::make_unique<TwitchEmotes>())
, emojis_(std::make_unique<Emojis>())
, gifTimer_(std::make_unique<GIFTimer>())
{
}
EmoteController::~EmoteController() = default;
void EmoteController::initialize()
{
this->emojis_->load();
this->gifTimer_->initialize();
}
TwitchEmotes *EmoteController::getTwitchEmotes() const
{
return this->twitchEmotes_.get();
}
Emojis *EmoteController::getEmojis() const
{
return this->emojis_.get();
}
GIFTimer *EmoteController::getGIFTimer() const
{
return this->gifTimer_.get();
}
} // namespace chatterino
@@ -0,0 +1,31 @@
#pragma once
#include <memory>
namespace chatterino {
class TwitchEmotes;
class Emojis;
class GIFTimer;
class EmoteController
{
public:
EmoteController();
virtual ~EmoteController();
virtual void initialize();
TwitchEmotes *getTwitchEmotes() const;
Emojis *getEmojis() const;
GIFTimer *getGIFTimer() const;
private:
std::unique_ptr<TwitchEmotes> twitchEmotes_;
std::unique_ptr<Emojis> emojis_;
std::unique_ptr<GIFTimer> gifTimer_;
};
} // namespace chatterino
+3 -3
View File
@@ -5,9 +5,9 @@
#include "common/network/NetworkRequest.hpp"
#include "common/network/NetworkResult.hpp"
#include "common/QLogging.hpp"
#include "controllers/emotes/EmoteController.hpp"
#include "debug/AssertInGuiThread.hpp"
#include "debug/Benchmark.hpp"
#include "singletons/Emotes.hpp"
#include "singletons/helper/GifTimer.hpp"
#include "singletons/WindowManager.hpp"
#include "util/DebugCount.hpp"
@@ -58,7 +58,7 @@ Frames::Frames(QList<Frame> &&frames)
DebugCount::increase("animated images");
this->gifTimerConnection_ =
app->getEmotes()->getGIFTimer().signal.connect([this] {
app->getEmotes()->getGIFTimer()->signal.connect([this] {
this->advance();
});
@@ -75,7 +75,7 @@ Frames::Frames(QList<Frame> &&frames)
else
{
this->durationOffset_ = std::min<int>(
int(app->getEmotes()->getGIFTimer().position() % totalLength),
int(app->getEmotes()->getGIFTimer()->position() % totalLength),
60000);
}
this->processOffset();
+2 -1
View File
@@ -5,6 +5,7 @@
#include "common/Literals.hpp"
#include "common/QLogging.hpp"
#include "controllers/accounts/AccountController.hpp"
#include "controllers/emotes/EmoteController.hpp"
#include "controllers/highlights/HighlightController.hpp"
#include "controllers/ignores/IgnoreController.hpp"
#include "controllers/ignores/IgnorePhrase.hpp"
@@ -18,6 +19,7 @@
#include "providers/bttv/BttvEmotes.hpp"
#include "providers/chatterino/ChatterinoBadges.hpp"
#include "providers/colors/ColorProvider.hpp"
#include "providers/emoji/Emojis.hpp"
#include "providers/ffz/FfzBadges.hpp"
#include "providers/ffz/FfzEmotes.hpp"
#include "providers/links/LinkResolver.hpp"
@@ -33,7 +35,6 @@
#include "providers/twitch/TwitchIrcServer.hpp"
#include "providers/twitch/TwitchUsers.hpp"
#include "providers/twitch/UserColor.hpp"
#include "singletons/Emotes.hpp"
#include "singletons/Resources.hpp"
#include "singletons/Settings.hpp"
#include "singletons/StreamerMode.hpp"
+2 -1
View File
@@ -2,6 +2,7 @@
#include "Application.hpp"
#include "common/Literals.hpp"
#include "controllers/emotes/EmoteController.hpp"
#include "controllers/moderationactions/ModerationAction.hpp"
#include "debug/Benchmark.hpp"
#include "messages/Emote.hpp"
@@ -10,7 +11,7 @@
#include "messages/layouts/MessageLayoutContext.hpp"
#include "messages/layouts/MessageLayoutElement.hpp"
#include "providers/emoji/Emojis.hpp"
#include "singletons/Emotes.hpp"
#include "providers/twitch/TwitchEmotes.hpp"
#include "singletons/Settings.hpp"
#include "singletons/Theme.hpp"
#include "util/DebugCount.hpp"
+1 -1
View File
@@ -5,6 +5,7 @@
#include "common/network/NetworkResult.hpp" // IWYU pragma: keep
#include "common/QLogging.hpp"
#include "controllers/accounts/AccountController.hpp"
#include "controllers/emotes/EmoteController.hpp"
#include "debug/AssertInGuiThread.hpp"
#include "messages/Emote.hpp"
#include "messages/MessageBuilder.hpp"
@@ -12,7 +13,6 @@
#include "providers/twitch/api/Helix.hpp"
#include "providers/twitch/TwitchCommon.hpp"
#include "providers/twitch/TwitchUsers.hpp"
#include "singletons/Emotes.hpp"
#include "util/CancellationToken.hpp"
#include "util/QStringHash.hpp" // IWYU pragma: keep
+2 -1
View File
@@ -8,6 +8,7 @@
#include "common/network/NetworkResult.hpp"
#include "common/QLogging.hpp"
#include "controllers/accounts/AccountController.hpp"
#include "controllers/emotes/EmoteController.hpp"
#include "controllers/notifications/NotificationController.hpp"
#include "controllers/twitch/LiveController.hpp"
#include "messages/Emote.hpp"
@@ -20,6 +21,7 @@
#include "providers/bttv/BttvEmotes.hpp"
#include "providers/bttv/BttvLiveUpdates.hpp"
#include "providers/bttv/liveupdates/BttvLiveUpdateMessages.hpp"
#include "providers/emoji/Emojis.hpp"
#include "providers/ffz/FfzBadges.hpp"
#include "providers/ffz/FfzEmotes.hpp"
#include "providers/recentmessages/Api.hpp"
@@ -36,7 +38,6 @@
#include "providers/twitch/TwitchCommon.hpp"
#include "providers/twitch/TwitchIrcServer.hpp"
#include "providers/twitch/TwitchUsers.hpp"
#include "singletons/Emotes.hpp"
#include "singletons/Settings.hpp"
#include "singletons/StreamerMode.hpp"
#include "singletons/Toasts.hpp"
+2 -1
View File
@@ -3,7 +3,8 @@
#include "Application.hpp"
#include "common/Aliases.hpp"
#include "common/QLogging.hpp"
#include "singletons/Emotes.hpp"
#include "controllers/emotes/EmoteController.hpp"
#include "providers/twitch/TwitchEmotes.hpp"
#include "util/IrcHelpers.hpp"
namespace {
-12
View File
@@ -1,12 +0,0 @@
#include "singletons/Emotes.hpp"
namespace chatterino {
Emotes::Emotes()
{
this->emojis.load();
this->gifTimer.initialize();
}
} // namespace chatterino
-45
View File
@@ -1,45 +0,0 @@
#pragma once
#include "providers/emoji/Emojis.hpp"
#include "providers/twitch/TwitchEmotes.hpp"
#include "singletons/helper/GifTimer.hpp"
namespace chatterino {
class IEmotes
{
public:
virtual ~IEmotes() = default;
virtual ITwitchEmotes *getTwitchEmotes() = 0;
virtual IEmojis *getEmojis() = 0;
virtual GIFTimer &getGIFTimer() = 0;
};
class Emotes final : public IEmotes
{
public:
Emotes();
ITwitchEmotes *getTwitchEmotes() final
{
return &this->twitch;
}
IEmojis *getEmojis() final
{
return &this->emojis;
}
GIFTimer &getGIFTimer() final
{
return this->gifTimer;
}
TwitchEmotes twitch;
Emojis emojis;
GIFTimer gifTimer;
};
} // namespace chatterino
+4 -3
View File
@@ -4,8 +4,9 @@
#include "common/FlagsEnum.hpp"
#include "common/Literals.hpp"
#include "common/QLogging.hpp"
#include "controllers/emotes/EmoteController.hpp"
#include "controllers/hotkeys/HotkeyController.hpp"
#include "singletons/Emotes.hpp"
#include "singletons/helper/GifTimer.hpp"
#include "singletons/Settings.hpp"
#include "singletons/WindowManager.hpp"
#include "util/PostToThread.hpp"
@@ -191,7 +192,7 @@ OverlayWindow::OverlayWindow(IndirectChannel channel,
this->updateScale();
this->triggerFirstActivation();
getApp()->getEmotes()->getGIFTimer().registerOpenOverlayWindow();
getApp()->getEmotes()->getGIFTimer()->registerOpenOverlayWindow();
}
OverlayWindow::~OverlayWindow()
@@ -199,7 +200,7 @@ OverlayWindow::~OverlayWindow()
#ifdef Q_OS_WIN
::DestroyCursor(this->sizeAllCursor_);
#endif
getApp()->getEmotes()->getGIFTimer().unregisterOpenOverlayWindow();
getApp()->getEmotes()->getGIFTimer()->unregisterOpenOverlayWindow();
}
void OverlayWindow::applyTheme()
+2 -1
View File
@@ -3,6 +3,7 @@
#include "Application.hpp"
#include "common/QLogging.hpp"
#include "controllers/accounts/AccountController.hpp"
#include "controllers/emotes/EmoteController.hpp"
#include "controllers/hotkeys/HotkeyController.hpp"
#include "debug/Benchmark.hpp"
#include "messages/Emote.hpp"
@@ -10,11 +11,11 @@
#include "messages/MessageBuilder.hpp"
#include "messages/MessageElement.hpp"
#include "providers/bttv/BttvEmotes.hpp"
#include "providers/emoji/Emojis.hpp"
#include "providers/ffz/FfzEmotes.hpp"
#include "providers/seventv/SeventvEmotes.hpp"
#include "providers/twitch/TwitchAccount.hpp"
#include "providers/twitch/TwitchChannel.hpp"
#include "singletons/Emotes.hpp"
#include "singletons/Settings.hpp"
#include "singletons/Theme.hpp"
#include "singletons/WindowManager.hpp"
+3 -3
View File
@@ -4,7 +4,7 @@
#include "controllers/commands/CommandController.hpp"
#include "controllers/commands/common/ChannelAction.hpp"
#include "mocks/BaseApplication.hpp"
#include "mocks/Emotes.hpp"
#include "mocks/EmoteController.hpp"
#include "mocks/Helix.hpp"
#include "mocks/Logging.hpp"
#include "mocks/TwitchIrcServer.hpp"
@@ -45,7 +45,7 @@ public:
return &this->commands;
}
IEmotes *getEmotes() override
EmoteController *getEmotes() override
{
return &this->emotes;
}
@@ -59,7 +59,7 @@ public:
AccountController accounts;
CommandController commands;
mock::MockTwitchIrcServer twitch;
mock::Emotes emotes;
mock::EmoteController emotes;
};
} // namespace
+3 -3
View File
@@ -7,7 +7,7 @@
#include "mocks/BaseApplication.hpp"
#include "mocks/Channel.hpp"
#include "mocks/ChatterinoBadges.hpp"
#include "mocks/Emotes.hpp"
#include "mocks/EmoteController.hpp"
#include "mocks/EmptyApplication.hpp"
#include "mocks/Logging.hpp"
#include "mocks/TwitchIrcServer.hpp"
@@ -34,7 +34,7 @@ public:
{
}
IEmotes *getEmotes() override
EmoteController *getEmotes() override
{
return &this->emotes;
}
@@ -81,7 +81,7 @@ public:
mock::EmptyLogging logging;
AccountController accounts;
mock::Emotes emotes;
mock::EmoteController emotes;
mock::UserDataController userData;
mock::MockTwitchIrcServer twitch;
mock::ChatterinoBadges chatterinoBadges;
+4 -3
View File
@@ -2,7 +2,8 @@
#include "controllers/accounts/AccountController.hpp"
#include "mocks/BaseApplication.hpp"
#include "mocks/Emotes.hpp"
#include "mocks/EmoteController.hpp"
#include "providers/twitch/TwitchEmotes.hpp"
#include "providers/twitch/TwitchIrc.hpp"
#include "Test.hpp"
@@ -15,7 +16,7 @@ class MockApplication : public mock::BaseApplication
public:
MockApplication() = default;
IEmotes *getEmotes() override
EmoteController *getEmotes() override
{
return &this->emotes;
}
@@ -25,7 +26,7 @@ public:
return &this->accounts;
}
mock::Emotes emotes;
mock::EmoteController emotes;
AccountController accounts;
};
+3 -4
View File
@@ -8,11 +8,10 @@
#include "messages/Emote.hpp"
#include "mocks/BaseApplication.hpp"
#include "mocks/Channel.hpp"
#include "mocks/Emotes.hpp"
#include "mocks/EmoteController.hpp"
#include "mocks/Helix.hpp"
#include "mocks/Logging.hpp"
#include "mocks/TwitchIrcServer.hpp"
#include "singletons/Emotes.hpp"
#include "singletons/Paths.hpp"
#include "singletons/Settings.hpp"
#include "Test.hpp"
@@ -52,7 +51,7 @@ public:
return &this->twitch;
}
IEmotes *getEmotes() override
EmoteController *getEmotes() override
{
return &this->emotes;
}
@@ -80,7 +79,7 @@ public:
mock::EmptyLogging logging;
AccountController accounts;
mock::MockTwitchIrcServer twitch;
mock::Emotes emotes;
mock::EmoteController emotes;
BttvEmotes bttvEmotes;
FfzEmotes ffzEmotes;
SeventvEmotes seventvEmotes;
+3 -4
View File
@@ -11,7 +11,7 @@
#include "mocks/BaseApplication.hpp"
#include "mocks/ChatterinoBadges.hpp"
#include "mocks/DisabledStreamerMode.hpp"
#include "mocks/Emotes.hpp"
#include "mocks/EmoteController.hpp"
#include "mocks/LinkResolver.hpp"
#include "mocks/Logging.hpp"
#include "mocks/TwitchIrcServer.hpp"
@@ -24,7 +24,6 @@
#include "providers/twitch/TwitchBadge.hpp"
#include "providers/twitch/TwitchBadges.hpp"
#include "providers/twitch/TwitchChannel.hpp"
#include "singletons/Emotes.hpp"
#include "Test.hpp"
#include "util/IrcHelpers.hpp"
#include "util/VectorMessageSink.hpp"
@@ -72,7 +71,7 @@ public:
{
}
IEmotes *getEmotes() override
EmoteController *getEmotes() override
{
return &this->emotes;
}
@@ -149,7 +148,7 @@ public:
mock::EmptyLogging logging;
AccountController accounts;
mock::Emotes emotes;
mock::EmoteController emotes;
mock::UserDataController userData;
mock::MockTwitchIrcServer twitch;
mock::ChatterinoBadges chatterinoBadges;
-1
View File
@@ -6,7 +6,6 @@
#include "messages/MessageBuilder.hpp"
#include "messages/MessageElement.hpp"
#include "mocks/BaseApplication.hpp"
#include "singletons/Emotes.hpp"
#include "singletons/Fonts.hpp"
#include "singletons/Settings.hpp"
#include "singletons/Theme.hpp"
+3 -3
View File
@@ -2,7 +2,7 @@
#include "messages/Image.hpp"
#include "mocks/BaseApplication.hpp"
#include "mocks/Emotes.hpp"
#include "mocks/EmoteController.hpp"
#include "singletons/Resources.hpp"
#include "Test.hpp"
@@ -19,12 +19,12 @@ class MockApplication : public mock::BaseApplication
public:
MockApplication() = default;
IEmotes *getEmotes() override
EmoteController *getEmotes() override
{
return &this->emotes;
}
mock::Emotes emotes;
mock::EmoteController emotes;
};
class ModerationActionTest : public ::testing::Test
+3 -3
View File
@@ -14,7 +14,7 @@
# include "messages/Message.hpp"
# include "mocks/BaseApplication.hpp"
# include "mocks/Channel.hpp"
# include "mocks/Emotes.hpp"
# include "mocks/EmoteController.hpp"
# include "mocks/Logging.hpp"
# include "mocks/TwitchIrcServer.hpp"
# include "NetworkHelpers.hpp"
@@ -92,7 +92,7 @@ public:
return &this->commands;
}
IEmotes *getEmotes() override
EmoteController *getEmotes() override
{
return &this->emotes;
}
@@ -110,7 +110,7 @@ public:
PluginController plugins;
mock::Logging logging;
CommandController commands;
mock::Emotes emotes;
mock::EmoteController emotes;
MockTwitch twitch;
};
+3 -3
View File
@@ -6,7 +6,7 @@
#include "controllers/commands/CommandController.hpp"
#include "controllers/hotkeys/HotkeyController.hpp"
#include "mocks/BaseApplication.hpp"
#include "mocks/Emotes.hpp"
#include "mocks/EmoteController.hpp"
#include "singletons/Fonts.hpp"
#include "singletons/Paths.hpp"
#include "singletons/Settings.hpp"
@@ -54,7 +54,7 @@ public:
return &this->commands;
}
IEmotes *getEmotes() override
EmoteController *getEmotes() override
{
return &this->emotes;
}
@@ -63,7 +63,7 @@ public:
WindowManager windowManager;
AccountController accounts;
CommandController commands;
mock::Emotes emotes;
mock::EmoteController emotes;
};
class SplitInputTest
+4 -3
View File
@@ -1,8 +1,9 @@
#include "providers/twitch/TwitchIrc.hpp"
#include "mocks/BaseApplication.hpp"
#include "mocks/Emotes.hpp"
#include "mocks/EmoteController.hpp"
#include "providers/twitch/TwitchBadge.hpp"
#include "providers/twitch/TwitchEmotes.hpp"
#include "Test.hpp"
#include "util/IrcHelpers.hpp"
@@ -15,12 +16,12 @@ class MockApplication : public mock::BaseApplication
public:
MockApplication() = default;
IEmotes *getEmotes() override
EmoteController *getEmotes() override
{
return &this->emotes;
}
mock::Emotes emotes;
mock::EmoteController emotes;
};
} // namespace