mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
disallow users on your ignore list to get your current games (#6109)
This commit is contained in:
parent
0f11fbe599
commit
0147a1d41f
2 changed files with 25 additions and 1 deletions
|
|
@ -79,8 +79,21 @@ void UserContextMenu::retranslateUi()
|
|||
|
||||
void UserContextMenu::gamesOfUserReceived(const Response &resp, const CommandContainer &commandContainer)
|
||||
{
|
||||
const Response_GetGamesOfUser &response = resp.GetExtension(Response_GetGamesOfUser::ext);
|
||||
const Command_GetGamesOfUser &cmd = commandContainer.session_command(0).GetExtension(Command_GetGamesOfUser::ext);
|
||||
if (resp.response_code() == Response::RespNameNotFound) {
|
||||
QMessageBox::critical(static_cast<QWidget *>(parent()), tr("Error"), tr("This user does not exist."));
|
||||
return;
|
||||
} else if (resp.response_code() == Response::RespInIgnoreList) {
|
||||
QMessageBox::critical(
|
||||
static_cast<QWidget *>(parent()), tr("Error"),
|
||||
tr("You are being ignored by %1 and can't see their games.").arg(QString::fromStdString(cmd.user_name())));
|
||||
return;
|
||||
} else if (resp.response_code() != Response::RespOk) {
|
||||
QMessageBox::critical(static_cast<QWidget *>(parent()), tr("Error"),
|
||||
tr("Could not get %1's games.").arg(QString::fromStdString(cmd.user_name())));
|
||||
return;
|
||||
}
|
||||
const Response_GetGamesOfUser &response = resp.GetExtension(Response_GetGamesOfUser::ext);
|
||||
|
||||
QMap<int, GameTypeMap> gameTypeMap;
|
||||
QMap<int, QString> roomMap;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue