mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Give description for /ignore and allow @username for various commands
This commit is contained in:
parent
12093d1bb6
commit
06497d44b9
2 changed files with 35 additions and 3 deletions
|
@ -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"));
|
||||||
|
|
Loading…
Reference in a new issue