renamed Twitch to twitch
This commit is contained in:
+2
-2
@@ -208,10 +208,10 @@ void Application::initialize()
|
|||||||
// TODO(pajlada): Unlisten to all authed topics instead of only moderation topics
|
// TODO(pajlada): Unlisten to all authed topics instead of only moderation topics
|
||||||
// this->twitch.pubsub->UnlistenAllAuthedTopics();
|
// 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();
|
RequestModerationActions();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ AccountController::AccountController()
|
|||||||
|
|
||||||
void AccountController::load()
|
void AccountController::load()
|
||||||
{
|
{
|
||||||
this->Twitch.load();
|
this->twitch.load();
|
||||||
}
|
}
|
||||||
|
|
||||||
AccountModel *AccountController::createModel(QObject *parent)
|
AccountModel *AccountController::createModel(QObject *parent)
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public:
|
|||||||
|
|
||||||
void load();
|
void load();
|
||||||
|
|
||||||
providers::twitch::TwitchAccountManager Twitch;
|
providers::twitch::TwitchAccountManager twitch;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
util::SortedSignalVector<std::shared_ptr<Account>, util::SharedPtrElementLess<Account>>
|
util::SortedSignalVector<std::shared_ptr<Account>, util::SharedPtrElementLess<Account>>
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ QString CommandController::execCommand(const QString &text, ChannelPtr channel,
|
|||||||
} else if (commandName == "/ignore" && words.size() >= 2) {
|
} else if (commandName == "/ignore" && words.size() >= 2) {
|
||||||
auto app = getApp();
|
auto app = getApp();
|
||||||
|
|
||||||
auto user = app->accounts->Twitch.getCurrent();
|
auto user = app->accounts->twitch.getCurrent();
|
||||||
auto target = words.at(1);
|
auto target = words.at(1);
|
||||||
|
|
||||||
if (user->isAnon()) {
|
if (user->isAnon()) {
|
||||||
@@ -138,7 +138,7 @@ QString CommandController::execCommand(const QString &text, ChannelPtr channel,
|
|||||||
} else if (commandName == "/unignore" && words.size() >= 2) {
|
} else if (commandName == "/unignore" && words.size() >= 2) {
|
||||||
auto app = getApp();
|
auto app = getApp();
|
||||||
|
|
||||||
auto user = app->accounts->Twitch.getCurrent();
|
auto user = app->accounts->twitch.getCurrent();
|
||||||
auto target = words.at(1);
|
auto target = words.at(1);
|
||||||
|
|
||||||
if (user->isAnon()) {
|
if (user->isAnon()) {
|
||||||
@@ -161,7 +161,7 @@ QString CommandController::execCommand(const QString &text, ChannelPtr channel,
|
|||||||
|
|
||||||
messages::MessageBuilder b;
|
messages::MessageBuilder b;
|
||||||
|
|
||||||
b.emplace<messages::TextElement>(app->accounts->Twitch.getCurrent()->getUserName(),
|
b.emplace<messages::TextElement>(app->accounts->twitch.getCurrent()->getUserName(),
|
||||||
messages::MessageElement::Text);
|
messages::MessageElement::Text);
|
||||||
b.emplace<messages::TextElement>("->", messages::MessageElement::Text);
|
b.emplace<messages::TextElement>("->", messages::MessageElement::Text);
|
||||||
b.emplace<messages::TextElement>(words[1], messages::MessageElement::Text);
|
b.emplace<messages::TextElement>(words[1], messages::MessageElement::Text);
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ TwitchChannel::TwitchChannel(const QString &channelName, Communi::IrcConnection
|
|||||||
this->refreshLiveStatus(); //
|
this->refreshLiveStatus(); //
|
||||||
});
|
});
|
||||||
|
|
||||||
this->managedConnect(app->accounts->Twitch.currentUserChanged,
|
this->managedConnect(app->accounts->twitch.currentUserChanged,
|
||||||
[this]() { this->setMod(false); });
|
[this]() { this->setMod(false); });
|
||||||
|
|
||||||
auto refreshPubSubState = [=]() {
|
auto refreshPubSubState = [=]() {
|
||||||
@@ -56,7 +56,7 @@ TwitchChannel::TwitchChannel(const QString &channelName, Communi::IrcConnection
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto account = app->accounts->Twitch.getCurrent();
|
auto account = app->accounts->twitch.getCurrent();
|
||||||
if (account && !account->getUserId().isEmpty()) {
|
if (account && !account->getUserId().isEmpty()) {
|
||||||
app->twitch.pubsub->listenToChannelModerationActions(this->roomID, account);
|
app->twitch.pubsub->listenToChannelModerationActions(this->roomID, account);
|
||||||
}
|
}
|
||||||
@@ -64,7 +64,7 @@ TwitchChannel::TwitchChannel(const QString &channelName, Communi::IrcConnection
|
|||||||
|
|
||||||
this->userStateChanged.connect(refreshPubSubState);
|
this->userStateChanged.connect(refreshPubSubState);
|
||||||
this->roomIDchanged.connect(refreshPubSubState);
|
this->roomIDchanged.connect(refreshPubSubState);
|
||||||
this->managedConnect(app->accounts->Twitch.currentUserChanged, refreshPubSubState);
|
this->managedConnect(app->accounts->twitch.currentUserChanged, refreshPubSubState);
|
||||||
refreshPubSubState();
|
refreshPubSubState();
|
||||||
|
|
||||||
this->fetchMessages.connect([this] {
|
this->fetchMessages.connect([this] {
|
||||||
@@ -190,9 +190,9 @@ bool TwitchChannel::isBroadcaster()
|
|||||||
{
|
{
|
||||||
auto app = getApp();
|
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()
|
bool TwitchChannel::hasModRights()
|
||||||
@@ -215,7 +215,7 @@ void TwitchChannel::addRecentChatter(const std::shared_ptr<messages::Message> &m
|
|||||||
void TwitchChannel::addJoinedUser(const QString &user)
|
void TwitchChannel::addJoinedUser(const QString &user)
|
||||||
{
|
{
|
||||||
auto *app = getApp();
|
auto *app = getApp();
|
||||||
if (user == app->accounts->Twitch.getCurrent()->getUserName() ||
|
if (user == app->accounts->twitch.getCurrent()->getUserName() ||
|
||||||
!app->settings->showJoins.getValue()) {
|
!app->settings->showJoins.getValue()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -241,7 +241,7 @@ void TwitchChannel::addPartedUser(const QString &user)
|
|||||||
{
|
{
|
||||||
auto *app = getApp();
|
auto *app = getApp();
|
||||||
|
|
||||||
if (user == app->accounts->Twitch.getCurrent()->getUserName() ||
|
if (user == app->accounts->twitch.getCurrent()->getUserName() ||
|
||||||
!app->settings->showJoins.getValue()) {
|
!app->settings->showJoins.getValue()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ bool TwitchMessageBuilder::isIgnored() const
|
|||||||
if (app->settings->enableTwitchIgnoredUsers && this->tags.contains("user-id")) {
|
if (app->settings->enableTwitchIgnoredUsers && this->tags.contains("user-id")) {
|
||||||
auto sourceUserID = this->tags.value("user-id").toString();
|
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) {
|
if (sourceUserID == user.id) {
|
||||||
debug::Log("Blocking message because it's from blocked user {}", user.name);
|
debug::Log("Blocking message because it's from blocked user {}", user.name);
|
||||||
return true;
|
return true;
|
||||||
@@ -79,7 +79,7 @@ bool TwitchMessageBuilder::isIgnored() const
|
|||||||
if (app->settings->enableTwitchIgnoredUsers && this->tags.contains("user-id")) {
|
if (app->settings->enableTwitchIgnoredUsers && this->tags.contains("user-id")) {
|
||||||
auto sourceUserID = this->tags.value("user-id").toString();
|
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) {
|
if (sourceUserID == user.id) {
|
||||||
debug::Log("Blocking message because it's from blocked user {}", user.name);
|
debug::Log("Blocking message because it's from blocked user {}", user.name);
|
||||||
return true;
|
return true;
|
||||||
@@ -359,7 +359,7 @@ void TwitchMessageBuilder::appendUsername()
|
|||||||
FontStyle::ChatMediumBold)
|
FontStyle::ChatMediumBold)
|
||||||
->setLink({Link::UserInfo, this->userName});
|
->setLink({Link::UserInfo, this->userName});
|
||||||
|
|
||||||
auto currentUser = app->accounts->Twitch.getCurrent();
|
auto currentUser = app->accounts->twitch.getCurrent();
|
||||||
|
|
||||||
// Separator
|
// Separator
|
||||||
this->emplace<TextElement>("->", MessageElement::Text,
|
this->emplace<TextElement>("->", MessageElement::Text,
|
||||||
@@ -391,7 +391,7 @@ void TwitchMessageBuilder::parseHighlights()
|
|||||||
|
|
||||||
auto app = getApp();
|
auto app = getApp();
|
||||||
|
|
||||||
auto currentUser = app->accounts->Twitch.getCurrent();
|
auto currentUser = app->accounts->twitch.getCurrent();
|
||||||
|
|
||||||
QString currentUsername = currentUser->getUserName();
|
QString currentUsername = currentUser->getUserName();
|
||||||
|
|
||||||
|
|||||||
@@ -28,13 +28,13 @@ TwitchServer::TwitchServer()
|
|||||||
|
|
||||||
void TwitchServer::initialize()
|
void TwitchServer::initialize()
|
||||||
{
|
{
|
||||||
getApp()->accounts->Twitch.currentUserChanged.connect(
|
getApp()->accounts->twitch.currentUserChanged.connect(
|
||||||
[this]() { util::postToThread([this] { this->connect(); }); });
|
[this]() { util::postToThread([this] { this->connect(); }); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void TwitchServer::initializeConnection(IrcConnection *connection, bool isRead, bool isWrite)
|
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();
|
qDebug() << "logging in as" << account->getUserName();
|
||||||
|
|
||||||
|
|||||||
@@ -86,8 +86,8 @@ EmoteManager::EmoteManager()
|
|||||||
|
|
||||||
void EmoteManager::initialize()
|
void EmoteManager::initialize()
|
||||||
{
|
{
|
||||||
getApp()->accounts->Twitch.currentUserChanged.connect([this] {
|
getApp()->accounts->twitch.currentUserChanged.connect([this] {
|
||||||
auto currentUser = getApp()->accounts->Twitch.getCurrent();
|
auto currentUser = getApp()->accounts->twitch.getCurrent();
|
||||||
assert(currentUser);
|
assert(currentUser);
|
||||||
this->refreshTwitchEmotes(currentUser);
|
this->refreshTwitchEmotes(currentUser);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ static void put(QUrl url, std::function<void(QJsonObject)> successCallback)
|
|||||||
{
|
{
|
||||||
QNetworkRequest request(url);
|
QNetworkRequest request(url);
|
||||||
|
|
||||||
auto currentTwitchUser = getApp()->accounts->Twitch.getCurrent();
|
auto currentTwitchUser = getApp()->accounts->twitch.getCurrent();
|
||||||
QByteArray oauthToken;
|
QByteArray oauthToken;
|
||||||
if (currentTwitchUser) {
|
if (currentTwitchUser) {
|
||||||
oauthToken = currentTwitchUser->getOAuthToken().toUtf8();
|
oauthToken = currentTwitchUser->getOAuthToken().toUtf8();
|
||||||
@@ -130,7 +130,7 @@ static void sendDelete(QUrl url, std::function<void()> successCallback)
|
|||||||
{
|
{
|
||||||
QNetworkRequest request(url);
|
QNetworkRequest request(url);
|
||||||
|
|
||||||
auto currentTwitchUser = getApp()->accounts->Twitch.getCurrent();
|
auto currentTwitchUser = getApp()->accounts->twitch.getCurrent();
|
||||||
QByteArray oauthToken;
|
QByteArray oauthToken;
|
||||||
if (currentTwitchUser) {
|
if (currentTwitchUser) {
|
||||||
oauthToken = currentTwitchUser->getOAuthToken().toUtf8();
|
oauthToken = currentTwitchUser->getOAuthToken().toUtf8();
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ AccountPopupWidget::AccountPopupWidget(ChannelPtr _channel)
|
|||||||
connect(this, &AccountPopupWidget::refreshButtons, this,
|
connect(this, &AccountPopupWidget::refreshButtons, this,
|
||||||
&AccountPopupWidget::actuallyRefreshButtons, Qt::QueuedConnection);
|
&AccountPopupWidget::actuallyRefreshButtons, Qt::QueuedConnection);
|
||||||
|
|
||||||
app->accounts->Twitch.currentUserChanged.connect([this] {
|
app->accounts->twitch.currentUserChanged.connect([this] {
|
||||||
auto currentTwitchUser = getApp()->accounts->Twitch.getCurrent();
|
auto currentTwitchUser = getApp()->accounts->twitch.getCurrent();
|
||||||
if (!currentTwitchUser) {
|
if (!currentTwitchUser) {
|
||||||
// No twitch user set (should never happen)
|
// No twitch user set (should never happen)
|
||||||
return;
|
return;
|
||||||
@@ -112,7 +112,7 @@ AccountPopupWidget::AccountPopupWidget(ChannelPtr _channel)
|
|||||||
});
|
});
|
||||||
|
|
||||||
QObject::connect(this->ui->ignore, &QPushButton::clicked, this, [=]() {
|
QObject::connect(this->ui->ignore, &QPushButton::clicked, this, [=]() {
|
||||||
auto currentUser = getApp()->accounts->Twitch.getCurrent();
|
auto currentUser = getApp()->accounts->twitch.getCurrent();
|
||||||
|
|
||||||
if (!this->relationship.isIgnoring()) {
|
if (!this->relationship.isIgnoring()) {
|
||||||
currentUser->ignoreByID(this->popupWidgetUser.userID, this->popupWidgetUser.username,
|
currentUser->ignoreByID(this->popupWidgetUser.userID, this->popupWidgetUser.username,
|
||||||
@@ -224,7 +224,7 @@ void AccountPopupWidget::getUserData()
|
|||||||
});
|
});
|
||||||
|
|
||||||
auto app = getApp();
|
auto app = getApp();
|
||||||
auto currentUser = app->accounts->Twitch.getCurrent();
|
auto currentUser = app->accounts->twitch.getCurrent();
|
||||||
|
|
||||||
currentUser->checkFollow(this->popupWidgetUser.userID, [=](auto result) {
|
currentUser->checkFollow(this->popupWidgetUser.userID, [=](auto result) {
|
||||||
this->relationship.setFollowing(result == FollowResult_Following);
|
this->relationship.setFollowing(result == FollowResult_Following);
|
||||||
@@ -301,7 +301,7 @@ void AccountPopupWidget::sendCommand(QPushButton *button, QString command)
|
|||||||
|
|
||||||
void AccountPopupWidget::refreshLayouts()
|
void AccountPopupWidget::refreshLayouts()
|
||||||
{
|
{
|
||||||
auto currentTwitchUser = getApp()->accounts->Twitch.getCurrent();
|
auto currentTwitchUser = getApp()->accounts->twitch.getCurrent();
|
||||||
if (!currentTwitchUser) {
|
if (!currentTwitchUser) {
|
||||||
// No twitch user set (should never happen)
|
// No twitch user set (should never happen)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -14,18 +14,18 @@ AccountSwitchWidget::AccountSwitchWidget(QWidget *parent)
|
|||||||
|
|
||||||
this->addItem(ANONYMOUS_USERNAME_LABEL);
|
this->addItem(ANONYMOUS_USERNAME_LABEL);
|
||||||
|
|
||||||
for (const auto &userName : app->accounts->Twitch.getUsernames()) {
|
for (const auto &userName : app->accounts->twitch.getUsernames()) {
|
||||||
this->addItem(userName);
|
this->addItem(userName);
|
||||||
}
|
}
|
||||||
|
|
||||||
app->accounts->Twitch.userListUpdated.connect([=]() {
|
app->accounts->twitch.userListUpdated.connect([=]() {
|
||||||
this->blockSignals(true);
|
this->blockSignals(true);
|
||||||
|
|
||||||
this->clear();
|
this->clear();
|
||||||
|
|
||||||
this->addItem(ANONYMOUS_USERNAME_LABEL);
|
this->addItem(ANONYMOUS_USERNAME_LABEL);
|
||||||
|
|
||||||
for (const auto &userName : app->accounts->Twitch.getUsernames()) {
|
for (const auto &userName : app->accounts->twitch.getUsernames()) {
|
||||||
this->addItem(userName);
|
this->addItem(userName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,9 +40,9 @@ AccountSwitchWidget::AccountSwitchWidget(QWidget *parent)
|
|||||||
if (!this->selectedItems().isEmpty()) {
|
if (!this->selectedItems().isEmpty()) {
|
||||||
QString newUsername = this->currentItem()->text();
|
QString newUsername = this->currentItem()->text();
|
||||||
if (newUsername.compare(ANONYMOUS_USERNAME_LABEL, Qt::CaseInsensitive) == 0) {
|
if (newUsername.compare(ANONYMOUS_USERNAME_LABEL, Qt::CaseInsensitive) == 0) {
|
||||||
app->accounts->Twitch.currentUsername = "";
|
app->accounts->twitch.currentUsername = "";
|
||||||
} else {
|
} else {
|
||||||
app->accounts->Twitch.currentUsername = newUsername.toStdString();
|
app->accounts->twitch.currentUsername = newUsername.toStdString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -61,7 +61,7 @@ void AccountSwitchWidget::refreshSelection()
|
|||||||
if (this->count() > 0) {
|
if (this->count() > 0) {
|
||||||
auto app = getApp();
|
auto app = getApp();
|
||||||
|
|
||||||
auto currentUser = app->accounts->Twitch.getCurrent();
|
auto currentUser = app->accounts->twitch.getCurrent();
|
||||||
|
|
||||||
if (currentUser->isAnon()) {
|
if (currentUser->isAnon()) {
|
||||||
this->setCurrentRow(0);
|
this->setCurrentRow(0);
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ void EmotePopup::loadChannel(ChannelPtr _channel)
|
|||||||
|
|
||||||
auto app = getApp();
|
auto app = getApp();
|
||||||
|
|
||||||
QString userID = app->accounts->Twitch.getCurrent()->getUserId();
|
QString userID = app->accounts->twitch.getCurrent()->getUserId();
|
||||||
|
|
||||||
addEmotes(app->emotes->twitchAccountEmotes[userID.toStdString()].emotes,
|
addEmotes(app->emotes->twitchAccountEmotes[userID.toStdString()].emotes,
|
||||||
"Twitch Account Emotes", "Twitch Account Emote");
|
"Twitch Account Emotes", "Twitch Account Emote");
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ SplitHeader::SplitHeader(Split *_split)
|
|||||||
this->initializeChannelSignals(); //
|
this->initializeChannelSignals(); //
|
||||||
});
|
});
|
||||||
|
|
||||||
this->managedConnect(app->accounts->Twitch.currentUserChanged,
|
this->managedConnect(app->accounts->twitch.currentUserChanged,
|
||||||
[this] { this->updateModerationModeIcon(); });
|
[this] { this->updateModerationModeIcon(); });
|
||||||
|
|
||||||
this->setMouseTracking(true);
|
this->setMouseTracking(true);
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ void LogInWithCredentials(const std::string &userID, const std::string &username
|
|||||||
pajlada::Settings::Setting<std::string>::set("/accounts/uid" + userID + "/oauthToken",
|
pajlada::Settings::Setting<std::string>::set("/accounts/uid" + userID + "/oauthToken",
|
||||||
oauthToken);
|
oauthToken);
|
||||||
|
|
||||||
getApp()->accounts->Twitch.reloadUsers();
|
getApp()->accounts->twitch.reloadUsers();
|
||||||
|
|
||||||
messageBox.exec();
|
messageBox.exec();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ void IgnoreUsersPage::onShow()
|
|||||||
{
|
{
|
||||||
auto app = getApp();
|
auto app = getApp();
|
||||||
|
|
||||||
auto user = app->accounts->Twitch.getCurrent();
|
auto user = app->accounts->twitch.getCurrent();
|
||||||
|
|
||||||
if (user->isAnon()) {
|
if (user->isAnon()) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -31,12 +31,12 @@ Window::Window(WindowType _type)
|
|||||||
{
|
{
|
||||||
auto app = getApp();
|
auto app = getApp();
|
||||||
|
|
||||||
app->accounts->Twitch.currentUserChanged.connect([this] {
|
app->accounts->twitch.currentUserChanged.connect([this] {
|
||||||
if (this->userLabel == nullptr) {
|
if (this->userLabel == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto user = getApp()->accounts->Twitch.getCurrent();
|
auto user = getApp()->accounts->twitch.getCurrent();
|
||||||
|
|
||||||
if (user->isAnon()) {
|
if (user->isAnon()) {
|
||||||
this->refreshWindowTitle("Not logged in");
|
this->refreshWindowTitle("Not logged in");
|
||||||
|
|||||||
Reference in New Issue
Block a user