started to refactor Application
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "common/MutexValue.hpp"
|
||||
#include "common/Singleton.hpp"
|
||||
#include "providers/irc/AbstractIrcServer.hpp"
|
||||
#include "providers/twitch/TwitchAccount.hpp"
|
||||
#include "providers/twitch/TwitchChannel.hpp"
|
||||
@@ -11,12 +12,15 @@
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
class TwitchServer final : public AbstractIrcServer
|
||||
class PubSub;
|
||||
|
||||
class TwitchServer : public AbstractIrcServer, public Singleton
|
||||
{
|
||||
public:
|
||||
TwitchServer();
|
||||
virtual ~TwitchServer() override = default;
|
||||
|
||||
void initialize();
|
||||
virtual void initialize(Application &app) override;
|
||||
|
||||
// fourtf: ugh
|
||||
void forEachChannelAndSpecialChannels(std::function<void(ChannelPtr)> func);
|
||||
@@ -29,6 +33,8 @@ public:
|
||||
const ChannelPtr mentionsChannel;
|
||||
IndirectChannel watchingChannel;
|
||||
|
||||
PubSub *pubsub;
|
||||
|
||||
protected:
|
||||
void initializeConnection(IrcConnection *connection, bool isRead, bool isWrite) override;
|
||||
std::shared_ptr<Channel> createChannel(const QString &channelName) override;
|
||||
@@ -44,6 +50,8 @@ protected:
|
||||
private:
|
||||
void onMessageSendRequested(TwitchChannel *channel, const QString &message, bool &sent);
|
||||
|
||||
Application *app = nullptr;
|
||||
|
||||
std::mutex lastMessageMutex_;
|
||||
std::queue<std::chrono::steady_clock::time_point> lastMessagePleb_;
|
||||
std::queue<std::chrono::steady_clock::time_point> lastMessageMod_;
|
||||
|
||||
Reference in New Issue
Block a user