fix: global emotes not loading (#5435)

* fix: manually initialize twitchircserver after rest of singletons are initialized

this fixes global emotes not being loaded on startup, since initialize
was never called (since it was no longer added to the singleton list)

* unrelated nit: remove copy/move ctors/operators of twitchircserver
This commit is contained in:
pajlada
2024-06-03 10:31:30 +02:00
committed by GitHub
parent d00cadf4eb
commit 248cd46eb7
4 changed files with 11 additions and 7 deletions
+2
View File
@@ -211,6 +211,8 @@ void Application::initialize(Settings &settings, const Paths &paths)
singleton->initialize(settings, paths);
}
this->twitch->initialize();
// XXX: Loading Twitch badges after Helix has been initialized, which only happens after
// the AccountController initialize has been called
this->twitchBadges->loadTwitchBadges();
+1 -1
View File
@@ -165,7 +165,7 @@ TwitchIrcServer::TwitchIrcServer()
// false);
}
void TwitchIrcServer::initialize(Settings &settings, const Paths &paths)
void TwitchIrcServer::initialize()
{
getIApp()->getAccounts()->twitch.currentUserChanged.connect([this]() {
postToThread([this] {
+7 -5
View File
@@ -2,7 +2,6 @@
#include "common/Atomic.hpp"
#include "common/Channel.hpp"
#include "common/Singleton.hpp"
#include "providers/irc/AbstractIrcServer.hpp"
#include <pajlada/signals/signalholder.hpp>
@@ -52,15 +51,18 @@ public:
// Update this interface with TwitchIrcServer methods as needed
};
class TwitchIrcServer final : public AbstractIrcServer,
public Singleton,
public ITwitchIrcServer
class TwitchIrcServer final : public AbstractIrcServer, public ITwitchIrcServer
{
public:
TwitchIrcServer();
~TwitchIrcServer() override = default;
void initialize(Settings &settings, const Paths &paths) override;
TwitchIrcServer(const TwitchIrcServer &) = delete;
TwitchIrcServer(TwitchIrcServer &&) = delete;
TwitchIrcServer &operator=(const TwitchIrcServer &) = delete;
TwitchIrcServer &operator=(TwitchIrcServer &&) = delete;
void initialize();
void forEachChannelAndSpecialChannels(
std::function<void(ChannelPtr)> func) override;