renamed TwitchServer -> TwitchIrcServer

This commit is contained in:
fourtf 2019-09-15 13:02:02 +02:00
parent c3b65b4db0
commit 22ca20ad2a
23 changed files with 59 additions and 55 deletions

View file

@ -148,9 +148,9 @@ SOURCES += \
src/providers/twitch/TwitchChannel.cpp \
src/providers/twitch/TwitchEmotes.cpp \
src/providers/twitch/TwitchHelpers.cpp \
src/providers/twitch/TwitchIrcServer.cpp \
src/providers/twitch/TwitchMessageBuilder.cpp \
src/providers/twitch/TwitchParseCheerEmotes.cpp \
src/providers/twitch/TwitchServer.cpp \
src/providers/twitch/TwitchUser.cpp \
src/RunGui.cpp \
src/singletons/Badges.cpp \
@ -318,9 +318,9 @@ HEADERS += \
src/providers/twitch/TwitchCommon.hpp \
src/providers/twitch/TwitchEmotes.hpp \
src/providers/twitch/TwitchHelpers.hpp \
src/providers/twitch/TwitchIrcServer.hpp \
src/providers/twitch/TwitchMessageBuilder.hpp \
src/providers/twitch/TwitchParseCheerEmotes.hpp \
src/providers/twitch/TwitchServer.hpp \
src/providers/twitch/TwitchUser.hpp \
src/RunGui.hpp \
src/singletons/Badges.hpp \

View file

@ -15,7 +15,7 @@
#include "providers/ffz/FfzEmotes.hpp"
#include "providers/irc/Irc2.hpp"
#include "providers/twitch/PubsubClient.hpp"
#include "providers/twitch/TwitchServer.hpp"
#include "providers/twitch/TwitchIrcServer.hpp"
#include "singletons/Emotes.hpp"
#include "singletons/Fonts.hpp"
#include "singletons/Logging.hpp"
@ -60,7 +60,7 @@ Application::Application(Settings &_settings, Paths &_paths)
, ignores(&this->emplace<IgnoreController>())
, taggedUsers(&this->emplace<TaggedUsersController>())
, moderationActions(&this->emplace<ModerationActions>())
, twitch2(&this->emplace<TwitchServer>())
, twitch2(&this->emplace<TwitchIrcServer>())
, chatterinoBadges(&this->emplace<ChatterinoBadges>())
, logging(&this->emplace<Logging>())

View file

@ -8,7 +8,7 @@
namespace chatterino {
class TwitchServer;
class TwitchIrcServer;
class PubSub;
class CommandController;
@ -67,14 +67,14 @@ public:
IgnoreController *const ignores{};
TaggedUsersController *const taggedUsers{};
ModerationActions *const moderationActions{};
TwitchServer *const twitch2{};
TwitchIrcServer *const twitch2{};
ChatterinoBadges *const chatterinoBadges{};
/*[[deprecated]]*/ Logging *const logging{};
/// Provider-specific
struct {
/*[[deprecated("use twitch2 instead")]]*/ TwitchServer *server{};
/*[[deprecated("use twitch2 instead")]]*/ TwitchIrcServer *server{};
/*[[deprecated("use twitch2->pubsub instead")]]*/ PubSub *pubsub{};
} twitch;

View file

@ -8,7 +8,7 @@
#include "debug/Benchmark.hpp"
#include "debug/Log.hpp"
#include "providers/twitch/TwitchChannel.hpp"
#include "providers/twitch/TwitchServer.hpp"
#include "providers/twitch/TwitchIrcServer.hpp"
#include "singletons/Emotes.hpp"
#include "singletons/Settings.hpp"

View file

@ -11,7 +11,7 @@
#include "messages/MessageElement.hpp"
#include "providers/twitch/TwitchApi.hpp"
#include "providers/twitch/TwitchChannel.hpp"
#include "providers/twitch/TwitchServer.hpp"
#include "providers/twitch/TwitchIrcServer.hpp"
#include "singletons/Emotes.hpp"
#include "singletons/Paths.hpp"
#include "singletons/Settings.hpp"

View file

@ -6,7 +6,7 @@
#include "controllers/notifications/NotificationModel.hpp"
#include "debug/Log.hpp"
#include "providers/twitch/TwitchApi.hpp"
#include "providers/twitch/TwitchServer.hpp"
#include "providers/twitch/TwitchIrcServer.hpp"
#include "singletons/Toasts.hpp"
#include "singletons/WindowManager.hpp"
#include "widgets/Window.hpp"

View file

@ -20,7 +20,7 @@ protected:
QString chatroomOwnerId;
QString chatroomOwnerName;
friend class TwitchServer;
friend class TwitchIrcServer;
friend class TwitchMessageBuilder;
friend class IrcMessageHandler;
};

View file

@ -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();

View file

@ -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);
};

View file

@ -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>

View file

@ -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;
};

View file

@ -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;
}

View file

@ -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;

View file

@ -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"

View file

@ -1,7 +1,7 @@
#include "singletons/NativeMessaging.hpp"
#include "Application.hpp"
#include "providers/twitch/TwitchServer.hpp"
#include "providers/twitch/TwitchIrcServer.hpp"
#include "singletons/Paths.hpp"
#include "util/PostToThread.hpp"

View file

@ -6,7 +6,7 @@
#include "controllers/notifications/NotificationController.hpp"
#include "providers/twitch/TwitchChannel.hpp"
#include "providers/twitch/TwitchCommon.hpp"
#include "providers/twitch/TwitchServer.hpp"
#include "providers/twitch/TwitchIrcServer.hpp"
#include "singletons/Paths.hpp"
#include "util/StreamLink.hpp"
#include "widgets/helper/CommonTexts.hpp"

View file

@ -7,7 +7,7 @@
#include "providers/irc/Irc2.hpp"
#include "providers/irc/IrcChannel2.hpp"
#include "providers/irc/IrcServer.hpp"
#include "providers/twitch/TwitchServer.hpp"
#include "providers/twitch/TwitchIrcServer.hpp"
#include "singletons/Fonts.hpp"
#include "singletons/Paths.hpp"
#include "singletons/Settings.hpp"

View file

@ -4,7 +4,7 @@
#include "common/Credentials.hpp"
#include "common/Version.hpp"
#include "controllers/accounts/AccountController.hpp"
#include "providers/twitch/TwitchServer.hpp"
#include "providers/twitch/TwitchIrcServer.hpp"
#include "singletons/Settings.hpp"
#include "singletons/Theme.hpp"
#include "singletons/Updates.hpp"

View file

@ -1,7 +1,7 @@
#include "SelectChannelDialog.hpp"
#include "Application.hpp"
#include "providers/twitch/TwitchServer.hpp"
#include "providers/twitch/TwitchIrcServer.hpp"
#include "singletons/Theme.hpp"
#include "util/LayoutCreator.hpp"
#include "widgets/Notebook.hpp"

View file

@ -12,7 +12,7 @@
#include "messages/layouts/MessageLayout.hpp"
#include "messages/layouts/MessageLayoutElement.hpp"
#include "providers/twitch/TwitchChannel.hpp"
#include "providers/twitch/TwitchServer.hpp"
#include "providers/twitch/TwitchIrcServer.hpp"
#include "singletons/Settings.hpp"
#include "singletons/Theme.hpp"
#include "singletons/TooltipPreviewImage.hpp"

View file

@ -7,7 +7,7 @@
#include "providers/twitch/EmoteValue.hpp"
#include "providers/twitch/TwitchChannel.hpp"
#include "providers/twitch/TwitchMessageBuilder.hpp"
#include "providers/twitch/TwitchServer.hpp"
#include "providers/twitch/TwitchIrcServer.hpp"
#include "singletons/Settings.hpp"
#include "singletons/Theme.hpp"
#include "singletons/WindowManager.hpp"

View file

@ -6,7 +6,7 @@
#include "controllers/notifications/NotificationController.hpp"
#include "controllers/pings/PingController.hpp"
#include "providers/twitch/TwitchChannel.hpp"
#include "providers/twitch/TwitchServer.hpp"
#include "providers/twitch/TwitchIrcServer.hpp"
#include "singletons/Resources.hpp"
#include "singletons/Settings.hpp"
#include "singletons/Theme.hpp"

View file

@ -4,7 +4,7 @@
#include "controllers/commands/CommandController.hpp"
#include "messages/Link.hpp"
#include "providers/twitch/TwitchChannel.hpp"
#include "providers/twitch/TwitchServer.hpp"
#include "providers/twitch/TwitchIrcServer.hpp"
#include "singletons/Settings.hpp"
#include "singletons/Theme.hpp"
#include "util/LayoutCreator.hpp"