mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-10 01:56:01 -05:00
Nothing in the UI confirmed that a user had been added to the ignore list, so the action felt ambiguous and could be repeated by accident. Show an information dialog when the server acknowledges the add-to-ignore command. Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
@@ -606,7 +606,15 @@ void UserContextMenu::execAddToIgnore(const QString &userName)
|
||||
Command_AddToList cmd;
|
||||
cmd.set_list("ignore");
|
||||
cmd.set_user_name(userName.toStdString());
|
||||
client->sendCommand(client->prepareSessionCommand(cmd));
|
||||
PendingCommand *pend = client->prepareSessionCommand(cmd);
|
||||
connect(pend, &PendingCommand::finished, this,
|
||||
[this, userName](const Response &response, const CommandContainer &, const QVariant &) {
|
||||
if (response.response_code() == Response::RespOk) {
|
||||
QMessageBox::information(static_cast<QWidget *>(parent()), tr("Ignore list"),
|
||||
tr("%1 has been added to your ignore list.").arg(userName));
|
||||
}
|
||||
});
|
||||
client->sendCommand(pend);
|
||||
}
|
||||
|
||||
void UserContextMenu::execRemoveFromIgnore(const QString &userName)
|
||||
|
||||
Reference in New Issue
Block a user