diff --git a/chatterino.pro b/chatterino.pro index 3d3da9041..0e422fd50 100644 --- a/chatterino.pro +++ b/chatterino.pro @@ -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 \ diff --git a/src/Application.cpp b/src/Application.cpp index 4b17def9e..c0749037e 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -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()) , taggedUsers(&this->emplace()) , moderationActions(&this->emplace()) - , twitch2(&this->emplace()) + , twitch2(&this->emplace()) , chatterinoBadges(&this->emplace()) , logging(&this->emplace()) diff --git a/src/Application.hpp b/src/Application.hpp index 49c8fe96c..88cea1aba 100644 --- a/src/Application.hpp +++ b/src/Application.hpp @@ -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; diff --git a/src/common/CompletionModel.cpp b/src/common/CompletionModel.cpp index 9bac550dd..1e348fc35 100644 --- a/src/common/CompletionModel.cpp +++ b/src/common/CompletionModel.cpp @@ -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" diff --git a/src/controllers/commands/CommandController.cpp b/src/controllers/commands/CommandController.cpp index b6fe9b8e8..020f25f24 100644 --- a/src/controllers/commands/CommandController.cpp +++ b/src/controllers/commands/CommandController.cpp @@ -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" diff --git a/src/controllers/notifications/NotificationController.cpp b/src/controllers/notifications/NotificationController.cpp index 40643aa85..1c0b7ecc7 100644 --- a/src/controllers/notifications/NotificationController.cpp +++ b/src/controllers/notifications/NotificationController.cpp @@ -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" diff --git a/src/providers/twitch/ChatroomChannel.hpp b/src/providers/twitch/ChatroomChannel.hpp index 7131dd9d1..2ed249141 100644 --- a/src/providers/twitch/ChatroomChannel.hpp +++ b/src/providers/twitch/ChatroomChannel.hpp @@ -20,7 +20,7 @@ protected: QString chatroomOwnerId; QString chatroomOwnerName; - friend class TwitchServer; + friend class TwitchIrcServer; friend class TwitchMessageBuilder; friend class IrcMessageHandler; }; diff --git a/src/providers/twitch/IrcMessageHandler.cpp b/src/providers/twitch/IrcMessageHandler.cpp index b0a118325..5cbf439de 100644 --- a/src/providers/twitch/IrcMessageHandler.cpp +++ b/src/providers/twitch/IrcMessageHandler.cpp @@ -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 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 IrcMessageHandler::parseUserNoticeMessage( } void IrcMessageHandler::handleUserNoticeMessage(Communi::IrcMessage *message, - TwitchServer &server) + TwitchIrcServer &server) { auto data = message->toData(); diff --git a/src/providers/twitch/IrcMessageHandler.hpp b/src/providers/twitch/IrcMessageHandler.hpp index bf99c79ae..96bfb37a0 100644 --- a/src/providers/twitch/IrcMessageHandler.hpp +++ b/src/providers/twitch/IrcMessageHandler.hpp @@ -5,7 +5,7 @@ namespace chatterino { -class TwitchServer; +class TwitchIrcServer; class Channel; class IrcMessageHandler @@ -23,7 +23,7 @@ public: std::vector 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 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); }; diff --git a/src/providers/twitch/PubsubClient.hpp b/src/providers/twitch/PubsubClient.hpp index 9e2def087..132cd35a5 100644 --- a/src/providers/twitch/PubsubClient.hpp +++ b/src/providers/twitch/PubsubClient.hpp @@ -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 #include diff --git a/src/providers/twitch/TwitchChannel.hpp b/src/providers/twitch/TwitchChannel.hpp index e59c265ad..c74f67cce 100644 --- a/src/providers/twitch/TwitchChannel.hpp +++ b/src/providers/twitch/TwitchChannel.hpp @@ -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; }; diff --git a/src/providers/twitch/TwitchServer.cpp b/src/providers/twitch/TwitchIrcServer.cpp similarity index 84% rename from src/providers/twitch/TwitchServer.cpp rename to src/providers/twitch/TwitchIrcServer.cpp index ff6c1c9bb..7ecfbff89 100644 --- a/src/providers/twitch/TwitchServer.cpp +++ b/src/providers/twitch/TwitchIrcServer.cpp @@ -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 account = getApp()->accounts->twitch.getCurrent(); @@ -99,7 +99,8 @@ void TwitchServer::initializeConnection(IrcConnection *connection, this->open(type); } -std::shared_ptr TwitchServer::createChannel(const QString &channelName) +std::shared_ptr TwitchIrcServer::createChannel( + const QString &channelName) { std::shared_ptr channel; if (isChatroom(channelName)) @@ -123,12 +124,14 @@ std::shared_ptr TwitchServer::createChannel(const QString &channelName) return std::shared_ptr(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 TwitchServer::getCustomChannel( +std::shared_ptr TwitchIrcServer::getCustomChannel( const QString &channelName) { if (channelName == "/whispers") @@ -249,7 +253,7 @@ std::shared_ptr TwitchServer::getCustomChannel( return nullptr; } -void TwitchServer::forEachChannelAndSpecialChannels( +void TwitchIrcServer::forEachChannelAndSpecialChannels( std::function func) { this->forEachChannel(func); @@ -258,7 +262,7 @@ void TwitchServer::forEachChannelAndSpecialChannels( func(this->mentionsChannel); } -std::shared_ptr TwitchServer::getChannelOrEmptyByID( +std::shared_ptr TwitchIrcServer::getChannelOrEmptyByID( const QString &channelId) { std::lock_guard lock(this->channelMutex); @@ -283,19 +287,19 @@ std::shared_ptr 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; } diff --git a/src/providers/twitch/TwitchServer.hpp b/src/providers/twitch/TwitchIrcServer.hpp similarity index 91% rename from src/providers/twitch/TwitchServer.hpp rename to src/providers/twitch/TwitchIrcServer.hpp index c14347f4a..f492bc08f 100644 --- a/src/providers/twitch/TwitchServer.hpp +++ b/src/providers/twitch/TwitchIrcServer.hpp @@ -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; diff --git a/src/providers/twitch/TwitchMessageBuilder.cpp b/src/providers/twitch/TwitchMessageBuilder.cpp index 9b8d30cc2..d52721a12 100644 --- a/src/providers/twitch/TwitchMessageBuilder.cpp +++ b/src/providers/twitch/TwitchMessageBuilder.cpp @@ -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" diff --git a/src/singletons/NativeMessaging.cpp b/src/singletons/NativeMessaging.cpp index 46c5fcd2d..6188cba8f 100644 --- a/src/singletons/NativeMessaging.cpp +++ b/src/singletons/NativeMessaging.cpp @@ -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" diff --git a/src/singletons/Toasts.cpp b/src/singletons/Toasts.cpp index 94e12a064..9cb1486fd 100644 --- a/src/singletons/Toasts.cpp +++ b/src/singletons/Toasts.cpp @@ -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" diff --git a/src/singletons/WindowManager.cpp b/src/singletons/WindowManager.cpp index f59f7985c..73df122f2 100644 --- a/src/singletons/WindowManager.cpp +++ b/src/singletons/WindowManager.cpp @@ -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" diff --git a/src/widgets/Window.cpp b/src/widgets/Window.cpp index edfac26a9..840caf38f 100644 --- a/src/widgets/Window.cpp +++ b/src/widgets/Window.cpp @@ -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" diff --git a/src/widgets/dialogs/SelectChannelDialog.cpp b/src/widgets/dialogs/SelectChannelDialog.cpp index 07aea7fa8..91e9ef50e 100644 --- a/src/widgets/dialogs/SelectChannelDialog.cpp +++ b/src/widgets/dialogs/SelectChannelDialog.cpp @@ -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" diff --git a/src/widgets/helper/ChannelView.cpp b/src/widgets/helper/ChannelView.cpp index 3f936a9f3..c5d0cd6df 100644 --- a/src/widgets/helper/ChannelView.cpp +++ b/src/widgets/helper/ChannelView.cpp @@ -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" diff --git a/src/widgets/splits/Split.cpp b/src/widgets/splits/Split.cpp index 6c79d1d29..4d5a59b93 100644 --- a/src/widgets/splits/Split.cpp +++ b/src/widgets/splits/Split.cpp @@ -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" diff --git a/src/widgets/splits/SplitHeader.cpp b/src/widgets/splits/SplitHeader.cpp index c451f2ead..009f8031d 100644 --- a/src/widgets/splits/SplitHeader.cpp +++ b/src/widgets/splits/SplitHeader.cpp @@ -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" diff --git a/src/widgets/splits/SplitInput.cpp b/src/widgets/splits/SplitInput.cpp index a1f132d58..2d5dc5dd6 100644 --- a/src/widgets/splits/SplitInput.cpp +++ b/src/widgets/splits/SplitInput.cpp @@ -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"