diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-10-05 01:41:54 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-10-05 01:41:54 +0300 |
commit | ab545fee3daf930dc46aaf303355c1c578320484 (patch) | |
tree | 24c8286acb9fea22b1e689810be5534de2323623 /src/commandhandler.cpp | |
parent | 851bee28374c5c60114c9f78299e28eaa14891b3 (diff) | |
download | manaplus-ab545fee3daf930dc46aaf303355c1c578320484.tar.gz manaplus-ab545fee3daf930dc46aaf303355c1c578320484.tar.bz2 manaplus-ab545fee3daf930dc46aaf303355c1c578320484.tar.xz manaplus-ab545fee3daf930dc46aaf303355c1c578320484.zip |
Add blacklist relation. In this mode blocked trades, emotes, speech text.
Diffstat (limited to 'src/commandhandler.cpp')
-rw-r--r-- | src/commandhandler.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp index 189485461..f1b7518c5 100644 --- a/src/commandhandler.cpp +++ b/src/commandhandler.cpp @@ -112,6 +112,8 @@ void CommandHandler::handleCommand(const std::string &command, ChatTab *tab) handleDisregard(args, tab); else if (type == "neutral") handleNeutral(args, tab); + else if (type == "blacklist") + handleBlackList(args, tab); else if (type == "erase") handleErase(args, tab); else if (type == "join") @@ -523,9 +525,10 @@ void CommandHandler::handleUnignore(const std::string &args, ChatTab *tab) return; } - if (player_relations.getRelation(args) == PlayerRelation::IGNORED) + if (player_relations.getRelation(args) != PlayerRelation::NEUTRAL + && player_relations.getRelation(args) != PlayerRelation::FRIEND) { - player_relations.removePlayer(args); + player_relations.setRelation(args, PlayerRelation::NEUTRAL); } else { @@ -536,13 +539,17 @@ void CommandHandler::handleUnignore(const std::string &args, ChatTab *tab) if (tab) { - if (player_relations.getRelation(args) != PlayerRelation::IGNORED) + if (player_relations.getRelation(args) == PlayerRelation::NEUTRAL) tab->chatLog(_("Player no longer ignored!"), BY_SERVER); else tab->chatLog(_("Player could not be unignored!"), BY_SERVER); } } +void CommandHandler::handleBlackList(const std::string &args, ChatTab *tab) +{ + changeRelation(args, PlayerRelation::BLACKLISTED, _("blacklisted"), tab); +} void CommandHandler::handleErase(const std::string &args, ChatTab *tab) { |