don't pm people ignoring you

This commit is contained in:
Max-Wilhelm Bruker 2011-03-02 16:34:36 +01:00
parent 0afdbc7222
commit 1bee788210
9 changed files with 36 additions and 5 deletions

View file

@ -266,7 +266,7 @@ void ProtocolResponse::initializeHash()
responseHash.insert("spectators_not_allowed", RespSpectatorsNotAllowed);
responseHash.insert("only_buddies", RespOnlyBuddies);
responseHash.insert("user_level_too_low", RespUserLevelTooLow);
responseHash.insert("on_ignore_list", RespOnIgnoreList);
responseHash.insert("in_ignore_list", RespInIgnoreList);
}
Response_JoinRoom::Response_JoinRoom(int _cmdId, ResponseCode _responseCode, ServerInfo_Room *_roomInfo)

View file

@ -8,7 +8,7 @@
class DeckList;
enum ResponseCode { RespNothing, RespOk, RespInternalError, RespInvalidCommand, RespInvalidData, RespNameNotFound, RespLoginNeeded, RespFunctionNotAllowed, RespGameNotStarted, RespGameFull, RespContextError, RespWrongPassword, RespSpectatorsNotAllowed, RespOnlyBuddies, RespUserLevelTooLow, RespOnIgnoreList };
enum ResponseCode { RespNothing, RespOk, RespInternalError, RespInvalidCommand, RespInvalidData, RespNameNotFound, RespLoginNeeded, RespFunctionNotAllowed, RespGameNotStarted, RespGameFull, RespContextError, RespWrongPassword, RespSpectatorsNotAllowed, RespOnlyBuddies, RespUserLevelTooLow, RespInIgnoreList };
// PrivateZone: Contents of the zone are always visible to the owner,
// but not to anyone else.

View file

@ -183,7 +183,7 @@ ResponseCode Server_Game::checkJoin(ServerInfo_User *user, const QString &_passw
if (!static_cast<Server_Room *>(parent())->getServer()->getBuddyList(creatorInfo->getName()).contains(user->getName()))
return RespOnlyBuddies;
if (static_cast<Server_Room *>(parent())->getServer()->getIgnoreList(creatorInfo->getName()).contains(user->getName()))
return RespOnIgnoreList;
return RespInIgnoreList;
if (spectator) {
if (!spectatorsAllowed)
return RespSpectatorsNotAllowed;

View file

@ -281,6 +281,8 @@ ResponseCode Server_ProtocolHandler::cmdMessage(Command_Message *cmd, CommandCon
Server_ProtocolHandler *userHandler = server->getUsers().value(receiver);
if (!userHandler)
return RespNameNotFound;
if (userHandler->getIgnoreList().contains(userInfo->getName()))
return RespInIgnoreList;
cont->enqueueItem(new Event_Message(userInfo->getName(), receiver, cmd->getText()));
userHandler->sendProtocolItem(new Event_Message(userInfo->getName(), receiver, cmd->getText()));