renamed TwitchServer -> TwitchIrcServer
This commit is contained in:
@@ -20,7 +20,7 @@ protected:
|
||||
QString chatroomOwnerId;
|
||||
QString chatroomOwnerName;
|
||||
|
||||
friend class TwitchServer;
|
||||
friend class TwitchIrcServer;
|
||||
friend class TwitchMessageBuilder;
|
||||
friend class IrcMessageHandler;
|
||||
};
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "providers/twitch/TwitchChannel.hpp"
|
||||
#include "providers/twitch/TwitchHelpers.hpp"
|
||||
#include "providers/twitch/TwitchMessageBuilder.hpp"
|
||||
#include "providers/twitch/TwitchServer.hpp"
|
||||
#include "providers/twitch/TwitchIrcServer.hpp"
|
||||
#include "singletons/Resources.hpp"
|
||||
#include "singletons/Settings.hpp"
|
||||
#include "singletons/WindowManager.hpp"
|
||||
@@ -85,7 +85,7 @@ std::vector<MessagePtr> IrcMessageHandler::parsePrivMessage(
|
||||
}
|
||||
|
||||
void IrcMessageHandler::handlePrivMessage(Communi::IrcPrivateMessage *message,
|
||||
TwitchServer &server)
|
||||
TwitchIrcServer &server)
|
||||
{
|
||||
this->addMessage(message, message->target(), message->content(), server,
|
||||
false, message->isAction());
|
||||
@@ -93,7 +93,7 @@ void IrcMessageHandler::handlePrivMessage(Communi::IrcPrivateMessage *message,
|
||||
|
||||
void IrcMessageHandler::addMessage(Communi::IrcMessage *_message,
|
||||
const QString &target,
|
||||
const QString &content, TwitchServer &server,
|
||||
const QString &content, TwitchIrcServer &server,
|
||||
bool isSub, bool isAction)
|
||||
{
|
||||
QString channelName;
|
||||
@@ -439,7 +439,7 @@ std::vector<MessagePtr> IrcMessageHandler::parseUserNoticeMessage(
|
||||
}
|
||||
|
||||
void IrcMessageHandler::handleUserNoticeMessage(Communi::IrcMessage *message,
|
||||
TwitchServer &server)
|
||||
TwitchIrcServer &server)
|
||||
{
|
||||
auto data = message->toData();
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
class TwitchServer;
|
||||
class TwitchIrcServer;
|
||||
class Channel;
|
||||
|
||||
class IrcMessageHandler
|
||||
@@ -23,7 +23,7 @@ public:
|
||||
std::vector<MessagePtr> parsePrivMessage(
|
||||
Channel *channel, Communi::IrcPrivateMessage *message);
|
||||
void handlePrivMessage(Communi::IrcPrivateMessage *message,
|
||||
TwitchServer &server);
|
||||
TwitchIrcServer &server);
|
||||
|
||||
void handleRoomStateMessage(Communi::IrcMessage *message);
|
||||
void handleClearChatMessage(Communi::IrcMessage *message);
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
std::vector<MessagePtr> parseUserNoticeMessage(
|
||||
Channel *channel, Communi::IrcMessage *message);
|
||||
void handleUserNoticeMessage(Communi::IrcMessage *message,
|
||||
TwitchServer &server);
|
||||
TwitchIrcServer &server);
|
||||
|
||||
void handleModeMessage(Communi::IrcMessage *message);
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
|
||||
private:
|
||||
void addMessage(Communi::IrcMessage *message, const QString &target,
|
||||
const QString &content, TwitchServer &server, bool isResub,
|
||||
const QString &content, TwitchIrcServer &server, bool isResub,
|
||||
bool isAction);
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "providers/twitch/PubsubActions.hpp"
|
||||
#include "providers/twitch/TwitchAccount.hpp"
|
||||
#include "providers/twitch/TwitchServer.hpp"
|
||||
#include "providers/twitch/TwitchIrcServer.hpp"
|
||||
|
||||
#include <rapidjson/document.h>
|
||||
#include <QString>
|
||||
|
||||
@@ -30,7 +30,7 @@ class TwitchBadges;
|
||||
class FfzEmotes;
|
||||
class BttvEmotes;
|
||||
|
||||
class TwitchServer;
|
||||
class TwitchIrcServer;
|
||||
|
||||
class TwitchChannel : public Channel, pajlada::Signals::SignalHolder
|
||||
{
|
||||
@@ -172,7 +172,7 @@ private:
|
||||
QTimer liveStatusTimer_;
|
||||
QTimer chattersListTimer_;
|
||||
|
||||
friend class TwitchServer;
|
||||
friend class TwitchIrcServer;
|
||||
friend class TwitchMessageBuilder;
|
||||
friend class IrcMessageHandler;
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "TwitchServer.hpp"
|
||||
#include "TwitchIrcServer.hpp"
|
||||
|
||||
#include "Application.hpp"
|
||||
#include "common/Common.hpp"
|
||||
@@ -38,7 +38,7 @@ namespace {
|
||||
}
|
||||
} // namespace
|
||||
|
||||
TwitchServer::TwitchServer()
|
||||
TwitchIrcServer::TwitchIrcServer()
|
||||
: whispersChannel(new Channel("/whispers", Channel::Type::TwitchWhispers))
|
||||
, mentionsChannel(new Channel("/mentions", Channel::Type::TwitchMentions))
|
||||
, watchingChannel(Channel::getEmpty(), Channel::Type::TwitchWatching)
|
||||
@@ -53,7 +53,7 @@ TwitchServer::TwitchServer()
|
||||
// false);
|
||||
}
|
||||
|
||||
void TwitchServer::initialize(Settings &settings, Paths &paths)
|
||||
void TwitchIrcServer::initialize(Settings &settings, Paths &paths)
|
||||
{
|
||||
getApp()->accounts->twitch.currentUserChanged.connect(
|
||||
[this]() { postToThread([this] { this->connect(); }); });
|
||||
@@ -63,8 +63,8 @@ void TwitchServer::initialize(Settings &settings, Paths &paths)
|
||||
this->ffz.loadEmotes();
|
||||
}
|
||||
|
||||
void TwitchServer::initializeConnection(IrcConnection *connection,
|
||||
ConnectionType type)
|
||||
void TwitchIrcServer::initializeConnection(IrcConnection *connection,
|
||||
ConnectionType type)
|
||||
{
|
||||
std::shared_ptr<TwitchAccount> account =
|
||||
getApp()->accounts->twitch.getCurrent();
|
||||
@@ -99,7 +99,8 @@ void TwitchServer::initializeConnection(IrcConnection *connection,
|
||||
this->open(type);
|
||||
}
|
||||
|
||||
std::shared_ptr<Channel> TwitchServer::createChannel(const QString &channelName)
|
||||
std::shared_ptr<Channel> TwitchIrcServer::createChannel(
|
||||
const QString &channelName)
|
||||
{
|
||||
std::shared_ptr<TwitchChannel> channel;
|
||||
if (isChatroom(channelName))
|
||||
@@ -123,12 +124,14 @@ std::shared_ptr<Channel> TwitchServer::createChannel(const QString &channelName)
|
||||
return std::shared_ptr<Channel>(channel);
|
||||
}
|
||||
|
||||
void TwitchServer::privateMessageReceived(Communi::IrcPrivateMessage *message)
|
||||
void TwitchIrcServer::privateMessageReceived(
|
||||
Communi::IrcPrivateMessage *message)
|
||||
{
|
||||
IrcMessageHandler::getInstance().handlePrivMessage(message, *this);
|
||||
}
|
||||
|
||||
void TwitchServer::readConnectionMessageReceived(Communi::IrcMessage *message)
|
||||
void TwitchIrcServer::readConnectionMessageReceived(
|
||||
Communi::IrcMessage *message)
|
||||
{
|
||||
if (message->type() == Communi::IrcMessage::Type::Private)
|
||||
{
|
||||
@@ -155,7 +158,8 @@ void TwitchServer::readConnectionMessageReceived(Communi::IrcMessage *message)
|
||||
}
|
||||
}
|
||||
|
||||
void TwitchServer::writeConnectionMessageReceived(Communi::IrcMessage *message)
|
||||
void TwitchIrcServer::writeConnectionMessageReceived(
|
||||
Communi::IrcMessage *message)
|
||||
{
|
||||
const QString &command = message->command();
|
||||
|
||||
@@ -193,7 +197,7 @@ void TwitchServer::writeConnectionMessageReceived(Communi::IrcMessage *message)
|
||||
}
|
||||
}
|
||||
|
||||
void TwitchServer::onReadConnected(IrcConnection *connection)
|
||||
void TwitchIrcServer::onReadConnected(IrcConnection *connection)
|
||||
{
|
||||
AbstractIrcServer::onReadConnected(connection);
|
||||
|
||||
@@ -202,7 +206,7 @@ void TwitchServer::onReadConnected(IrcConnection *connection)
|
||||
connection->sendRaw("CAP REQ :twitch.tv/tags twitch.tv/membership");
|
||||
}
|
||||
|
||||
void TwitchServer::onWriteConnected(IrcConnection *connection)
|
||||
void TwitchIrcServer::onWriteConnected(IrcConnection *connection)
|
||||
{
|
||||
AbstractIrcServer::onWriteConnected(connection);
|
||||
|
||||
@@ -211,7 +215,7 @@ void TwitchServer::onWriteConnected(IrcConnection *connection)
|
||||
connection->sendRaw("CAP REQ :twitch.tv/tags twitch.tv/commands");
|
||||
}
|
||||
|
||||
std::shared_ptr<Channel> TwitchServer::getCustomChannel(
|
||||
std::shared_ptr<Channel> TwitchIrcServer::getCustomChannel(
|
||||
const QString &channelName)
|
||||
{
|
||||
if (channelName == "/whispers")
|
||||
@@ -249,7 +253,7 @@ std::shared_ptr<Channel> TwitchServer::getCustomChannel(
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void TwitchServer::forEachChannelAndSpecialChannels(
|
||||
void TwitchIrcServer::forEachChannelAndSpecialChannels(
|
||||
std::function<void(ChannelPtr)> func)
|
||||
{
|
||||
this->forEachChannel(func);
|
||||
@@ -258,7 +262,7 @@ void TwitchServer::forEachChannelAndSpecialChannels(
|
||||
func(this->mentionsChannel);
|
||||
}
|
||||
|
||||
std::shared_ptr<Channel> TwitchServer::getChannelOrEmptyByID(
|
||||
std::shared_ptr<Channel> TwitchIrcServer::getChannelOrEmptyByID(
|
||||
const QString &channelId)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(this->channelMutex);
|
||||
@@ -283,19 +287,19 @@ std::shared_ptr<Channel> TwitchServer::getChannelOrEmptyByID(
|
||||
return Channel::getEmpty();
|
||||
}
|
||||
|
||||
QString TwitchServer::cleanChannelName(const QString &dirtyChannelName)
|
||||
QString TwitchIrcServer::cleanChannelName(const QString &dirtyChannelName)
|
||||
{
|
||||
return dirtyChannelName.toLower();
|
||||
}
|
||||
|
||||
bool TwitchServer::hasSeparateWriteConnection() const
|
||||
bool TwitchIrcServer::hasSeparateWriteConnection() const
|
||||
{
|
||||
return true;
|
||||
// return getSettings()->twitchSeperateWriteConnection;
|
||||
}
|
||||
|
||||
void TwitchServer::onMessageSendRequested(TwitchChannel *channel,
|
||||
const QString &message, bool &sent)
|
||||
void TwitchIrcServer::onMessageSendRequested(TwitchChannel *channel,
|
||||
const QString &message, bool &sent)
|
||||
{
|
||||
sent = false;
|
||||
|
||||
@@ -354,11 +358,11 @@ void TwitchServer::onMessageSendRequested(TwitchChannel *channel,
|
||||
sent = true;
|
||||
}
|
||||
|
||||
const BttvEmotes &TwitchServer::getBttvEmotes() const
|
||||
const BttvEmotes &TwitchIrcServer::getBttvEmotes() const
|
||||
{
|
||||
return this->bttv;
|
||||
}
|
||||
const FfzEmotes &TwitchServer::getFfzEmotes() const
|
||||
const FfzEmotes &TwitchIrcServer::getFfzEmotes() const
|
||||
{
|
||||
return this->ffz;
|
||||
}
|
||||
@@ -20,11 +20,11 @@ class Paths;
|
||||
class PubSub;
|
||||
class TwitchChannel;
|
||||
|
||||
class TwitchServer final : public AbstractIrcServer, public Singleton
|
||||
class TwitchIrcServer final : public AbstractIrcServer, public Singleton
|
||||
{
|
||||
public:
|
||||
TwitchServer();
|
||||
virtual ~TwitchServer() override = default;
|
||||
TwitchIrcServer();
|
||||
virtual ~TwitchIrcServer() override = default;
|
||||
|
||||
virtual void initialize(Settings &settings, Paths &paths) override;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "providers/chatterino/ChatterinoBadges.hpp"
|
||||
#include "providers/twitch/TwitchBadges.hpp"
|
||||
#include "providers/twitch/TwitchChannel.hpp"
|
||||
#include "providers/twitch/TwitchServer.hpp"
|
||||
#include "providers/twitch/TwitchIrcServer.hpp"
|
||||
#include "singletons/Emotes.hpp"
|
||||
#include "singletons/Resources.hpp"
|
||||
#include "singletons/Settings.hpp"
|
||||
|
||||
Reference in New Issue
Block a user