2017-09-16 00:05:06 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "channel.hpp"
|
2017-12-31 00:50:07 +01:00
|
|
|
#include "singletons/emotemanager.hpp"
|
|
|
|
#include "singletons/ircmanager.hpp"
|
2017-12-31 22:58:35 +01:00
|
|
|
#include "util/concurrentmap.hpp"
|
2017-09-16 00:05:06 +02:00
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
namespace twitch {
|
|
|
|
|
|
|
|
class TwitchChannel : public Channel
|
|
|
|
{
|
2017-11-04 14:57:29 +01:00
|
|
|
QTimer *liveStatusTimer;
|
|
|
|
|
2017-09-16 00:05:06 +02:00
|
|
|
public:
|
2017-12-31 00:50:07 +01:00
|
|
|
explicit TwitchChannel(const QString &channelName);
|
2017-11-04 14:57:29 +01:00
|
|
|
~TwitchChannel();
|
2017-09-16 00:05:06 +02:00
|
|
|
|
|
|
|
void reloadChannelEmotes();
|
|
|
|
|
|
|
|
bool isEmpty() const override;
|
|
|
|
bool canSendMessage() const override;
|
|
|
|
void sendMessage(const QString &message) override;
|
|
|
|
|
2018-01-17 17:17:26 +01:00
|
|
|
bool isMod();
|
2018-01-17 18:36:12 +01:00
|
|
|
void setMod(bool value);
|
2018-01-17 17:17:26 +01:00
|
|
|
bool isBroadcaster();
|
|
|
|
bool hasModRights();
|
|
|
|
|
2017-12-31 22:58:35 +01:00
|
|
|
const std::shared_ptr<chatterino::util::EmoteMap> bttvChannelEmotes;
|
|
|
|
const std::shared_ptr<chatterino::util::EmoteMap> ffzChannelEmotes;
|
2017-12-23 23:24:35 +01:00
|
|
|
|
2017-11-04 14:57:29 +01:00
|
|
|
const QString subscriptionURL;
|
|
|
|
const QString channelURL;
|
|
|
|
const QString popoutPlayerURL;
|
2017-09-16 00:05:06 +02:00
|
|
|
|
2017-11-04 14:57:29 +01:00
|
|
|
void setRoomID(const QString &_roomID);
|
2017-09-16 00:05:06 +02:00
|
|
|
boost::signals2::signal<void()> roomIDchanged;
|
2017-11-04 14:57:29 +01:00
|
|
|
boost::signals2::signal<void()> onlineStatusChanged;
|
2017-09-16 00:05:06 +02:00
|
|
|
|
2017-12-28 00:03:52 +01:00
|
|
|
pajlada::Signals::NoArgBoltSignal fetchMessages;
|
2018-01-17 18:36:12 +01:00
|
|
|
boost::signals2::signal<void()> userStateChanged;
|
2017-12-28 00:03:52 +01:00
|
|
|
|
2017-11-04 14:57:29 +01:00
|
|
|
QString roomID;
|
2017-09-16 00:05:06 +02:00
|
|
|
bool isLive;
|
|
|
|
QString streamViewerCount;
|
|
|
|
QString streamStatus;
|
|
|
|
QString streamGame;
|
|
|
|
QString streamUptime;
|
|
|
|
|
|
|
|
private:
|
2017-11-04 14:57:29 +01:00
|
|
|
void setLive(bool newLiveStatus);
|
|
|
|
void refreshLiveStatus();
|
|
|
|
|
2017-12-28 00:03:52 +01:00
|
|
|
void fetchRecentMessages();
|
2018-01-17 17:17:26 +01:00
|
|
|
|
2018-01-17 18:36:12 +01:00
|
|
|
boost::signals2::connection connectedConnection;
|
|
|
|
|
2018-01-17 17:17:26 +01:00
|
|
|
bool mod;
|
2017-09-16 00:05:06 +02:00
|
|
|
};
|
2017-11-04 14:57:29 +01:00
|
|
|
|
|
|
|
} // namespace twitch
|
|
|
|
} // namespace chatterino
|