refactor: move event api initializations to TwitchIrcServer (#6198)

This commit is contained in:
pajlada
2025-05-10 15:17:00 +02:00
committed by GitHub
parent aa7630af71
commit e86ecf5d0b
6 changed files with 128 additions and 106 deletions
+9 -1
View File
@@ -25,6 +25,8 @@ class BttvEmotes;
class FfzEmotes;
class SeventvEmotes;
class RatelimitBucket;
class BttvLiveUpdates;
class SeventvEventAPI;
class ITwitchIrcServer
{
@@ -68,6 +70,9 @@ public:
virtual QString getLastUserThatWhisperedMe() const = 0;
virtual void setLastUserThatWhisperedMe(const QString &user) = 0;
virtual void initEventAPIs(BttvLiveUpdates *bttvLiveUpdates,
SeventvEventAPI *seventvEventAPI) = 0;
// Update this interface with TwitchIrcServer methods as needed
};
@@ -154,6 +159,9 @@ public:
QString getLastUserThatWhisperedMe() const override;
void setLastUserThatWhisperedMe(const QString &user) override;
void initEventAPIs(BttvLiveUpdates *bttvLiveUpdates,
SeventvEventAPI *seventvEventAPI) override;
protected:
void initializeConnection(IrcConnection *connection, ConnectionType type);
std::shared_ptr<Channel> createChannel(const QString &channelName);
@@ -193,7 +201,7 @@ private:
std::mutex connectionMutex_;
pajlada::Signals::SignalHolder connections_;
pajlada::Signals::SignalHolder signalHolder;
std::mutex lastMessageMutex_;
std::queue<std::chrono::steady_clock::time_point> lastMessagePleb_;