mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Fixed /ignore and /unignore as well as give description for the command (#611)
* Fixed /ignore and /unignore as well as give description for the command
This commit is contained in:
parent
aa0059ffe0
commit
ba99d62139
2 changed files with 12 additions and 6 deletions
|
@ -6,7 +6,6 @@
|
|||
#include "controllers/commands/Command.hpp"
|
||||
#include "controllers/commands/CommandModel.hpp"
|
||||
#include "messages/MessageBuilder.hpp"
|
||||
#include "providers/twitch/TwitchAccount.hpp"
|
||||
#include "providers/twitch/TwitchApi.hpp"
|
||||
#include "providers/twitch/TwitchChannel.hpp"
|
||||
#include "providers/twitch/TwitchServer.hpp"
|
||||
|
@ -172,7 +171,11 @@ QString CommandController::execCommand(const QString &text, ChannelPtr channel,
|
|||
channel->addMessage(Message::createSystemMessage(messageText));
|
||||
|
||||
return "";
|
||||
} else if (commandName == "/ignore" && words.size() >= 2) {
|
||||
} else if (commandName == "/ignore") {
|
||||
if (words.size() < 2) {
|
||||
channel->addMessage(Message::createSystemMessage("Usage: /ignore [user]"));
|
||||
return "";
|
||||
}
|
||||
auto app = getApp();
|
||||
|
||||
auto user = app->accounts->twitch.getCurrent();
|
||||
|
@ -189,7 +192,11 @@ QString CommandController::execCommand(const QString &text, ChannelPtr channel,
|
|||
});
|
||||
|
||||
return "";
|
||||
} else if (commandName == "/unignore" && words.size() >= 2) {
|
||||
} else if (commandName == "/unignore") {
|
||||
if (words.size() < 2) {
|
||||
channel->addMessage(Message::createSystemMessage("Usage: /unignore [user]"));
|
||||
return "";
|
||||
}
|
||||
auto app = getApp();
|
||||
|
||||
auto user = app->accounts->twitch.getCurrent();
|
||||
|
|
|
@ -130,7 +130,7 @@ void TwitchAccount::ignore(const QString &targetName,
|
|||
this->ignoreByID(targetUserId, targetName, onFinished); //
|
||||
};
|
||||
|
||||
PartialTwitchUser::byName(this->userName_).getId(onIdFetched);
|
||||
PartialTwitchUser::byName(targetName).getId(onIdFetched);
|
||||
}
|
||||
|
||||
void TwitchAccount::ignoreByID(const QString &targetUserID, const QString &targetName,
|
||||
|
@ -138,7 +138,6 @@ void TwitchAccount::ignoreByID(const QString &targetUserID, const QString &targe
|
|||
{
|
||||
QString url("https://api.twitch.tv/kraken/users/" + this->getUserId() + "/blocks/" +
|
||||
targetUserID);
|
||||
|
||||
NetworkRequest req(url, NetworkRequestType::Put);
|
||||
req.setCaller(QThread::currentThread());
|
||||
req.makeAuthorizedV5(this->getOAuthClient(), this->getOAuthToken());
|
||||
|
@ -197,7 +196,7 @@ void TwitchAccount::unignore(const QString &targetName,
|
|||
this->unignoreByID(targetUserId, targetName, onFinished); //
|
||||
};
|
||||
|
||||
PartialTwitchUser::byName(this->userName_).getId(onIdFetched);
|
||||
PartialTwitchUser::byName(targetName).getId(onIdFetched);
|
||||
}
|
||||
|
||||
void TwitchAccount::unignoreByID(
|
||||
|
|
Loading…
Reference in a new issue