GUI: put player on ignore list slot bugfix
This commit is contained in:
@@ -1413,16 +1413,21 @@ bool gameLobbyDialogImpl::playerIsOnIgnoreList(unsigned playerId) {
|
||||
}
|
||||
|
||||
|
||||
void gameLobbyDialogImpl::putPlayerOnIgnoreList(unsigned playerId) {
|
||||
void gameLobbyDialogImpl::putPlayerOnIgnoreList() {
|
||||
|
||||
if(!playerIsOnIgnoreList(playerId)) {
|
||||
if(!treeWidget_NickList->selectedItems().isEmpty()) {
|
||||
|
||||
list<std::string> playerIgnoreList = myConfig->readConfigStringList("PlayerIgnoreList");
|
||||
playerIgnoreList.push_back(QString("%1,%2").arg(playerId).arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerId).playerName.c_str())).toUtf8().constData());
|
||||
myConfig->writeConfigStringList("PlayerIgnoreList", playerIgnoreList);
|
||||
myConfig->writeBuffer();
|
||||
unsigned playerId = treeWidget_NickList->selectedItems().at(0)->data(0, Qt::UserRole).toUInt();
|
||||
|
||||
myChat->refreshIgnoreList();
|
||||
if(!playerIsOnIgnoreList(playerId)) {
|
||||
|
||||
list<std::string> playerIgnoreList = myConfig->readConfigStringList("PlayerIgnoreList");
|
||||
playerIgnoreList.push_back(QString("%1,%2").arg(playerId).arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerId).playerName.c_str())).toUtf8().constData());
|
||||
myConfig->writeConfigStringList("PlayerIgnoreList", playerIgnoreList);
|
||||
myConfig->writeBuffer();
|
||||
|
||||
myChat->refreshIgnoreList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ public slots:
|
||||
void showInvitationDialog(unsigned gameId, unsigned playerIdFrom);
|
||||
void chatInfoPlayerInvitation(unsigned gameId, unsigned playerIdWho, unsigned playerIdFrom);
|
||||
void chatInfoPlayerRejectedInvitation(unsigned gameId, unsigned playerIdWho, DenyGameInvitationReason reason);
|
||||
void putPlayerOnIgnoreList(unsigned playerid);
|
||||
void putPlayerOnIgnoreList();
|
||||
bool playerIsOnIgnoreList(unsigned playerid);
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user