Give description for /ignore and allow @username for various commands

This commit is contained in:
LajamerrMittesdine 2018-07-12 13:23:47 -04:00
parent 12093d1bb6
commit 06497d44b9
2 changed files with 35 additions and 3 deletions

View file

@ -74,7 +74,7 @@
<file>avatars/pajlada.png</file> <file>avatars/pajlada.png</file>
<file>images/download_update.png</file> <file>images/download_update.png</file>
<file>images/download_update_error.png</file> <file>images/download_update_error.png</file>
<file>images/pajaDank.png</file> <file>images/pajaDank.png</file>
</qresource> </qresource>
<qresource prefix="/qt/etc"> <qresource prefix="/qt/etc">
<file>qt.conf</file> <file>qt.conf</file>

View file

@ -172,12 +172,22 @@ QString CommandController::execCommand(const QString &text, ChannelPtr channel,
channel->addMessage(Message::createSystemMessage(messageText)); channel->addMessage(Message::createSystemMessage(messageText));
return ""; 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 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 (words.at(1).at(0) == "@") {
target = words.at(1).mid(1);
} else {
target = words.at(1);
}
if (user->isAnon()) { if (user->isAnon()) {
channel->addMessage( channel->addMessage(
Message::createSystemMessage("You must be logged in to ignore someone")); Message::createSystemMessage("You must be logged in to ignore someone"));
@ -189,12 +199,22 @@ QString CommandController::execCommand(const QString &text, ChannelPtr channel,
}); });
return ""; 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 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 (words.at(1).at(0) == "@") {
target = words.at(1).mid(1);
} else {
target = words.at(1);
}
if (user->isAnon()) { if (user->isAnon()) {
channel->addMessage( channel->addMessage(
Message::createSystemMessage("You must be logged in to ignore someone")); Message::createSystemMessage("You must be logged in to ignore someone"));
@ -216,6 +236,12 @@ QString CommandController::execCommand(const QString &text, ChannelPtr channel,
auto user = app->accounts->twitch.getCurrent(); auto user = app->accounts->twitch.getCurrent();
auto target = words.at(1); auto target = words.at(1);
if (words.at(1).at(0) == "@") {
target = words.at(1).mid(1);
} else {
target = words.at(1);
}
if (user->isAnon()) { if (user->isAnon()) {
channel->addMessage( channel->addMessage(
Message::createSystemMessage("You must be logged in to follow someone")); Message::createSystemMessage("You must be logged in to follow someone"));
@ -245,6 +271,12 @@ QString CommandController::execCommand(const QString &text, ChannelPtr channel,
auto user = app->accounts->twitch.getCurrent(); auto user = app->accounts->twitch.getCurrent();
auto target = words.at(1); auto target = words.at(1);
if (words.at(1).at(0) == "@") {
target = words.at(1).mid(1);
} else {
target = words.at(1);
}
if (user->isAnon()) { if (user->isAnon()) {
channel->addMessage( channel->addMessage(
Message::createSystemMessage("You must be logged in to follow someone")); Message::createSystemMessage("You must be logged in to follow someone"));