diff --git a/src/application.cpp b/src/application.cpp index d833ca157..4d3c89d42 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -208,10 +208,10 @@ void Application::initialize() // TODO(pajlada): Unlisten to all authed topics instead of only moderation topics // this->twitch.pubsub->UnlistenAllAuthedTopics(); - this->twitch.pubsub->listenToWhispers(this->accounts->Twitch.getCurrent()); // + this->twitch.pubsub->listenToWhispers(this->accounts->twitch.getCurrent()); // }; - this->accounts->Twitch.currentUserChanged.connect(RequestModerationActions); + this->accounts->twitch.currentUserChanged.connect(RequestModerationActions); RequestModerationActions(); } diff --git a/src/controllers/accounts/accountcontroller.cpp b/src/controllers/accounts/accountcontroller.cpp index f201034fb..9de7e3ffd 100644 --- a/src/controllers/accounts/accountcontroller.cpp +++ b/src/controllers/accounts/accountcontroller.cpp @@ -12,7 +12,7 @@ AccountController::AccountController() void AccountController::load() { - this->Twitch.load(); + this->twitch.load(); } AccountModel *AccountController::createModel(QObject *parent) diff --git a/src/controllers/accounts/accountcontroller.hpp b/src/controllers/accounts/accountcontroller.hpp index 34329a741..585c28896 100644 --- a/src/controllers/accounts/accountcontroller.hpp +++ b/src/controllers/accounts/accountcontroller.hpp @@ -22,7 +22,7 @@ public: void load(); - providers::twitch::TwitchAccountManager Twitch; + providers::twitch::TwitchAccountManager twitch; private: util::SortedSignalVector, util::SharedPtrElementLess> diff --git a/src/controllers/commands/commandcontroller.cpp b/src/controllers/commands/commandcontroller.cpp index dda163769..2640f3599 100644 --- a/src/controllers/commands/commandcontroller.cpp +++ b/src/controllers/commands/commandcontroller.cpp @@ -121,7 +121,7 @@ QString CommandController::execCommand(const QString &text, ChannelPtr channel, } else if (commandName == "/ignore" && words.size() >= 2) { auto app = getApp(); - auto user = app->accounts->Twitch.getCurrent(); + auto user = app->accounts->twitch.getCurrent(); auto target = words.at(1); if (user->isAnon()) { @@ -138,7 +138,7 @@ QString CommandController::execCommand(const QString &text, ChannelPtr channel, } else if (commandName == "/unignore" && words.size() >= 2) { auto app = getApp(); - auto user = app->accounts->Twitch.getCurrent(); + auto user = app->accounts->twitch.getCurrent(); auto target = words.at(1); if (user->isAnon()) { @@ -161,7 +161,7 @@ QString CommandController::execCommand(const QString &text, ChannelPtr channel, messages::MessageBuilder b; - b.emplace(app->accounts->Twitch.getCurrent()->getUserName(), + b.emplace(app->accounts->twitch.getCurrent()->getUserName(), messages::MessageElement::Text); b.emplace("->", messages::MessageElement::Text); b.emplace(words[1], messages::MessageElement::Text); diff --git a/src/providers/twitch/twitchchannel.cpp b/src/providers/twitch/twitchchannel.cpp index 562dc6d31..2ba9a5de2 100644 --- a/src/providers/twitch/twitchchannel.cpp +++ b/src/providers/twitch/twitchchannel.cpp @@ -44,7 +44,7 @@ TwitchChannel::TwitchChannel(const QString &channelName, Communi::IrcConnection this->refreshLiveStatus(); // }); - this->managedConnect(app->accounts->Twitch.currentUserChanged, + this->managedConnect(app->accounts->twitch.currentUserChanged, [this]() { this->setMod(false); }); auto refreshPubSubState = [=]() { @@ -56,7 +56,7 @@ TwitchChannel::TwitchChannel(const QString &channelName, Communi::IrcConnection return; } - auto account = app->accounts->Twitch.getCurrent(); + auto account = app->accounts->twitch.getCurrent(); if (account && !account->getUserId().isEmpty()) { app->twitch.pubsub->listenToChannelModerationActions(this->roomID, account); } @@ -64,7 +64,7 @@ TwitchChannel::TwitchChannel(const QString &channelName, Communi::IrcConnection this->userStateChanged.connect(refreshPubSubState); this->roomIDchanged.connect(refreshPubSubState); - this->managedConnect(app->accounts->Twitch.currentUserChanged, refreshPubSubState); + this->managedConnect(app->accounts->twitch.currentUserChanged, refreshPubSubState); refreshPubSubState(); this->fetchMessages.connect([this] { @@ -190,9 +190,9 @@ bool TwitchChannel::isBroadcaster() { auto app = getApp(); - qDebug() << "ASD" << (this->name == app->accounts->Twitch.getCurrent()->getUserName()); + qDebug() << "ASD" << (this->name == app->accounts->twitch.getCurrent()->getUserName()); - return this->name == app->accounts->Twitch.getCurrent()->getUserName(); + return this->name == app->accounts->twitch.getCurrent()->getUserName(); } bool TwitchChannel::hasModRights() @@ -215,7 +215,7 @@ void TwitchChannel::addRecentChatter(const std::shared_ptr &m void TwitchChannel::addJoinedUser(const QString &user) { auto *app = getApp(); - if (user == app->accounts->Twitch.getCurrent()->getUserName() || + if (user == app->accounts->twitch.getCurrent()->getUserName() || !app->settings->showJoins.getValue()) { return; } @@ -241,7 +241,7 @@ void TwitchChannel::addPartedUser(const QString &user) { auto *app = getApp(); - if (user == app->accounts->Twitch.getCurrent()->getUserName() || + if (user == app->accounts->twitch.getCurrent()->getUserName() || !app->settings->showJoins.getValue()) { return; } diff --git a/src/providers/twitch/twitchmessagebuilder.cpp b/src/providers/twitch/twitchmessagebuilder.cpp index f3da63514..040269740 100644 --- a/src/providers/twitch/twitchmessagebuilder.cpp +++ b/src/providers/twitch/twitchmessagebuilder.cpp @@ -68,7 +68,7 @@ bool TwitchMessageBuilder::isIgnored() const if (app->settings->enableTwitchIgnoredUsers && this->tags.contains("user-id")) { auto sourceUserID = this->tags.value("user-id").toString(); - for (const auto &user : app->accounts->Twitch.getCurrent()->getIgnores()) { + for (const auto &user : app->accounts->twitch.getCurrent()->getIgnores()) { if (sourceUserID == user.id) { debug::Log("Blocking message because it's from blocked user {}", user.name); return true; @@ -79,7 +79,7 @@ bool TwitchMessageBuilder::isIgnored() const if (app->settings->enableTwitchIgnoredUsers && this->tags.contains("user-id")) { auto sourceUserID = this->tags.value("user-id").toString(); - for (const auto &user : app->accounts->Twitch.getCurrent()->getIgnores()) { + for (const auto &user : app->accounts->twitch.getCurrent()->getIgnores()) { if (sourceUserID == user.id) { debug::Log("Blocking message because it's from blocked user {}", user.name); return true; @@ -359,7 +359,7 @@ void TwitchMessageBuilder::appendUsername() FontStyle::ChatMediumBold) ->setLink({Link::UserInfo, this->userName}); - auto currentUser = app->accounts->Twitch.getCurrent(); + auto currentUser = app->accounts->twitch.getCurrent(); // Separator this->emplace("->", MessageElement::Text, @@ -391,7 +391,7 @@ void TwitchMessageBuilder::parseHighlights() auto app = getApp(); - auto currentUser = app->accounts->Twitch.getCurrent(); + auto currentUser = app->accounts->twitch.getCurrent(); QString currentUsername = currentUser->getUserName(); diff --git a/src/providers/twitch/twitchserver.cpp b/src/providers/twitch/twitchserver.cpp index 14405a697..59661a259 100644 --- a/src/providers/twitch/twitchserver.cpp +++ b/src/providers/twitch/twitchserver.cpp @@ -28,13 +28,13 @@ TwitchServer::TwitchServer() void TwitchServer::initialize() { - getApp()->accounts->Twitch.currentUserChanged.connect( + getApp()->accounts->twitch.currentUserChanged.connect( [this]() { util::postToThread([this] { this->connect(); }); }); } void TwitchServer::initializeConnection(IrcConnection *connection, bool isRead, bool isWrite) { - std::shared_ptr account = getApp()->accounts->Twitch.getCurrent(); + std::shared_ptr account = getApp()->accounts->twitch.getCurrent(); qDebug() << "logging in as" << account->getUserName(); diff --git a/src/singletons/emotemanager.cpp b/src/singletons/emotemanager.cpp index 191c5c2fb..a083c30fe 100644 --- a/src/singletons/emotemanager.cpp +++ b/src/singletons/emotemanager.cpp @@ -86,8 +86,8 @@ EmoteManager::EmoteManager() void EmoteManager::initialize() { - getApp()->accounts->Twitch.currentUserChanged.connect([this] { - auto currentUser = getApp()->accounts->Twitch.getCurrent(); + getApp()->accounts->twitch.currentUserChanged.connect([this] { + auto currentUser = getApp()->accounts->twitch.getCurrent(); assert(currentUser); this->refreshTwitchEmotes(currentUser); }); diff --git a/src/util/urlfetch.hpp b/src/util/urlfetch.hpp index 3e88eb639..991e5a562 100644 --- a/src/util/urlfetch.hpp +++ b/src/util/urlfetch.hpp @@ -100,7 +100,7 @@ static void put(QUrl url, std::function successCallback) { QNetworkRequest request(url); - auto currentTwitchUser = getApp()->accounts->Twitch.getCurrent(); + auto currentTwitchUser = getApp()->accounts->twitch.getCurrent(); QByteArray oauthToken; if (currentTwitchUser) { oauthToken = currentTwitchUser->getOAuthToken().toUtf8(); @@ -130,7 +130,7 @@ static void sendDelete(QUrl url, std::function successCallback) { QNetworkRequest request(url); - auto currentTwitchUser = getApp()->accounts->Twitch.getCurrent(); + auto currentTwitchUser = getApp()->accounts->twitch.getCurrent(); QByteArray oauthToken; if (currentTwitchUser) { oauthToken = currentTwitchUser->getOAuthToken().toUtf8(); diff --git a/src/widgets/accountpopup.cpp b/src/widgets/accountpopup.cpp index 85cba6fbd..93e05e123 100644 --- a/src/widgets/accountpopup.cpp +++ b/src/widgets/accountpopup.cpp @@ -39,8 +39,8 @@ AccountPopupWidget::AccountPopupWidget(ChannelPtr _channel) connect(this, &AccountPopupWidget::refreshButtons, this, &AccountPopupWidget::actuallyRefreshButtons, Qt::QueuedConnection); - app->accounts->Twitch.currentUserChanged.connect([this] { - auto currentTwitchUser = getApp()->accounts->Twitch.getCurrent(); + app->accounts->twitch.currentUserChanged.connect([this] { + auto currentTwitchUser = getApp()->accounts->twitch.getCurrent(); if (!currentTwitchUser) { // No twitch user set (should never happen) return; @@ -112,7 +112,7 @@ AccountPopupWidget::AccountPopupWidget(ChannelPtr _channel) }); QObject::connect(this->ui->ignore, &QPushButton::clicked, this, [=]() { - auto currentUser = getApp()->accounts->Twitch.getCurrent(); + auto currentUser = getApp()->accounts->twitch.getCurrent(); if (!this->relationship.isIgnoring()) { currentUser->ignoreByID(this->popupWidgetUser.userID, this->popupWidgetUser.username, @@ -224,7 +224,7 @@ void AccountPopupWidget::getUserData() }); auto app = getApp(); - auto currentUser = app->accounts->Twitch.getCurrent(); + auto currentUser = app->accounts->twitch.getCurrent(); currentUser->checkFollow(this->popupWidgetUser.userID, [=](auto result) { this->relationship.setFollowing(result == FollowResult_Following); @@ -301,7 +301,7 @@ void AccountPopupWidget::sendCommand(QPushButton *button, QString command) void AccountPopupWidget::refreshLayouts() { - auto currentTwitchUser = getApp()->accounts->Twitch.getCurrent(); + auto currentTwitchUser = getApp()->accounts->twitch.getCurrent(); if (!currentTwitchUser) { // No twitch user set (should never happen) return; diff --git a/src/widgets/accountswitchwidget.cpp b/src/widgets/accountswitchwidget.cpp index b0bb046c4..ebec62ea9 100644 --- a/src/widgets/accountswitchwidget.cpp +++ b/src/widgets/accountswitchwidget.cpp @@ -14,18 +14,18 @@ AccountSwitchWidget::AccountSwitchWidget(QWidget *parent) this->addItem(ANONYMOUS_USERNAME_LABEL); - for (const auto &userName : app->accounts->Twitch.getUsernames()) { + for (const auto &userName : app->accounts->twitch.getUsernames()) { this->addItem(userName); } - app->accounts->Twitch.userListUpdated.connect([=]() { + app->accounts->twitch.userListUpdated.connect([=]() { this->blockSignals(true); this->clear(); this->addItem(ANONYMOUS_USERNAME_LABEL); - for (const auto &userName : app->accounts->Twitch.getUsernames()) { + for (const auto &userName : app->accounts->twitch.getUsernames()) { this->addItem(userName); } @@ -40,9 +40,9 @@ AccountSwitchWidget::AccountSwitchWidget(QWidget *parent) if (!this->selectedItems().isEmpty()) { QString newUsername = this->currentItem()->text(); if (newUsername.compare(ANONYMOUS_USERNAME_LABEL, Qt::CaseInsensitive) == 0) { - app->accounts->Twitch.currentUsername = ""; + app->accounts->twitch.currentUsername = ""; } else { - app->accounts->Twitch.currentUsername = newUsername.toStdString(); + app->accounts->twitch.currentUsername = newUsername.toStdString(); } } }); @@ -61,7 +61,7 @@ void AccountSwitchWidget::refreshSelection() if (this->count() > 0) { auto app = getApp(); - auto currentUser = app->accounts->Twitch.getCurrent(); + auto currentUser = app->accounts->twitch.getCurrent(); if (currentUser->isAnon()) { this->setCurrentRow(0); diff --git a/src/widgets/emotepopup.cpp b/src/widgets/emotepopup.cpp index 89f52ae9a..05cd621d2 100644 --- a/src/widgets/emotepopup.cpp +++ b/src/widgets/emotepopup.cpp @@ -84,7 +84,7 @@ void EmotePopup::loadChannel(ChannelPtr _channel) auto app = getApp(); - QString userID = app->accounts->Twitch.getCurrent()->getUserId(); + QString userID = app->accounts->twitch.getCurrent()->getUserId(); addEmotes(app->emotes->twitchAccountEmotes[userID.toStdString()].emotes, "Twitch Account Emotes", "Twitch Account Emote"); diff --git a/src/widgets/helper/splitheader.cpp b/src/widgets/helper/splitheader.cpp index 702c7ff7f..3510c67a6 100644 --- a/src/widgets/helper/splitheader.cpp +++ b/src/widgets/helper/splitheader.cpp @@ -94,7 +94,7 @@ SplitHeader::SplitHeader(Split *_split) this->initializeChannelSignals(); // }); - this->managedConnect(app->accounts->Twitch.currentUserChanged, + this->managedConnect(app->accounts->twitch.currentUserChanged, [this] { this->updateModerationModeIcon(); }); this->setMouseTracking(true); diff --git a/src/widgets/logindialog.cpp b/src/widgets/logindialog.cpp index 2d46d4c32..393d36ccd 100644 --- a/src/widgets/logindialog.cpp +++ b/src/widgets/logindialog.cpp @@ -50,7 +50,7 @@ void LogInWithCredentials(const std::string &userID, const std::string &username pajlada::Settings::Setting::set("/accounts/uid" + userID + "/oauthToken", oauthToken); - getApp()->accounts->Twitch.reloadUsers(); + getApp()->accounts->twitch.reloadUsers(); messageBox.exec(); } diff --git a/src/widgets/settingspages/ignoreuserspage.cpp b/src/widgets/settingspages/ignoreuserspage.cpp index 6adf533e3..477c38471 100644 --- a/src/widgets/settingspages/ignoreuserspage.cpp +++ b/src/widgets/settingspages/ignoreuserspage.cpp @@ -91,7 +91,7 @@ void IgnoreUsersPage::onShow() { auto app = getApp(); - auto user = app->accounts->Twitch.getCurrent(); + auto user = app->accounts->twitch.getCurrent(); if (user->isAnon()) { return; diff --git a/src/widgets/window.cpp b/src/widgets/window.cpp index 8d99fb88a..c9a045882 100644 --- a/src/widgets/window.cpp +++ b/src/widgets/window.cpp @@ -31,12 +31,12 @@ Window::Window(WindowType _type) { auto app = getApp(); - app->accounts->Twitch.currentUserChanged.connect([this] { + app->accounts->twitch.currentUserChanged.connect([this] { if (this->userLabel == nullptr) { return; } - auto user = getApp()->accounts->Twitch.getCurrent(); + auto user = getApp()->accounts->twitch.getCurrent(); if (user->isAnon()) { this->refreshWindowTitle("Not logged in");