2018-02-05 15:11:50 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "providers/irc/abstractircserver.hpp"
|
|
|
|
#include "providers/twitch/twitchaccount.hpp"
|
|
|
|
#include "providers/twitch/twitchchannel.hpp"
|
|
|
|
|
2018-04-15 15:09:31 +02:00
|
|
|
#include <memory>
|
|
|
|
|
2018-02-05 15:11:50 +01:00
|
|
|
namespace chatterino {
|
|
|
|
namespace providers {
|
|
|
|
namespace twitch {
|
2018-03-25 11:37:57 +02:00
|
|
|
|
2018-02-05 15:11:50 +01:00
|
|
|
class TwitchServer final : public irc::AbstractIrcServer
|
|
|
|
{
|
|
|
|
TwitchServer();
|
|
|
|
|
|
|
|
public:
|
|
|
|
static TwitchServer &getInstance();
|
|
|
|
|
2018-02-05 21:20:38 +01:00
|
|
|
// fourtf: ugh
|
|
|
|
void forEachChannelAndSpecialChannels(std::function<void(ChannelPtr)> func);
|
|
|
|
|
2018-02-05 15:11:50 +01:00
|
|
|
const ChannelPtr whispersChannel;
|
|
|
|
const ChannelPtr mentionsChannel;
|
|
|
|
|
|
|
|
protected:
|
2018-04-01 16:43:30 +02:00
|
|
|
void initializeConnection(Communi::IrcConnection *connection, bool isRead,
|
|
|
|
bool isWrite) override;
|
|
|
|
std::shared_ptr<Channel> createChannel(const QString &channelName) override;
|
2018-02-05 15:11:50 +01:00
|
|
|
|
2018-04-01 16:43:30 +02:00
|
|
|
void privateMessageReceived(Communi::IrcPrivateMessage *message) override;
|
|
|
|
void messageReceived(Communi::IrcMessage *message) override;
|
|
|
|
void writeConnectionMessageReceived(Communi::IrcMessage *message) override;
|
2018-02-05 15:11:50 +01:00
|
|
|
|
2018-04-01 16:43:30 +02:00
|
|
|
std::shared_ptr<Channel> getCustomChannel(const QString &channelname) override;
|
2018-04-01 15:10:15 +02:00
|
|
|
|
|
|
|
QString CleanChannelName(const QString &dirtyChannelName) override;
|
2018-02-05 15:11:50 +01:00
|
|
|
};
|
2018-03-25 11:37:57 +02:00
|
|
|
|
2018-02-05 15:11:50 +01:00
|
|
|
} // namespace twitch
|
|
|
|
} // namespace providers
|
|
|
|
} // namespace chatterino
|