renamed Twitch to twitch

This commit is contained in:
fourtf 2018-05-26 20:26:25 +02:00
parent 8c9be20f9b
commit 7e68e662e3
16 changed files with 41 additions and 41 deletions

View file

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

View file

@ -12,7 +12,7 @@ AccountController::AccountController()
void AccountController::load()
{
this->Twitch.load();
this->twitch.load();
}
AccountModel *AccountController::createModel(QObject *parent)

View file

@ -22,7 +22,7 @@ public:
void load();
providers::twitch::TwitchAccountManager Twitch;
providers::twitch::TwitchAccountManager twitch;
private:
util::SortedSignalVector<std::shared_ptr<Account>, util::SharedPtrElementLess<Account>>

View file

@ -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<messages::TextElement>(app->accounts->Twitch.getCurrent()->getUserName(),
b.emplace<messages::TextElement>(app->accounts->twitch.getCurrent()->getUserName(),
messages::MessageElement::Text);
b.emplace<messages::TextElement>("->", messages::MessageElement::Text);
b.emplace<messages::TextElement>(words[1], messages::MessageElement::Text);

View file

@ -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<messages::Message> &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;
}

View file

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

View file

@ -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<TwitchAccount> account = getApp()->accounts->Twitch.getCurrent();
std::shared_ptr<TwitchAccount> account = getApp()->accounts->twitch.getCurrent();
qDebug() << "logging in as" << account->getUserName();

View file

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

View file

@ -100,7 +100,7 @@ static void put(QUrl url, std::function<void(QJsonObject)> 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<void()> successCallback)
{
QNetworkRequest request(url);
auto currentTwitchUser = getApp()->accounts->Twitch.getCurrent();
auto currentTwitchUser = getApp()->accounts->twitch.getCurrent();
QByteArray oauthToken;
if (currentTwitchUser) {
oauthToken = currentTwitchUser->getOAuthToken().toUtf8();

View file

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

View file

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

View file

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

View file

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

View file

@ -50,7 +50,7 @@ void LogInWithCredentials(const std::string &userID, const std::string &username
pajlada::Settings::Setting<std::string>::set("/accounts/uid" + userID + "/oauthToken",
oauthToken);
getApp()->accounts->Twitch.reloadUsers();
getApp()->accounts->twitch.reloadUsers();
messageBox.exec();
}

View file

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

View file

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