From ab545fee3daf930dc46aaf303355c1c578320484 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 5 Oct 2011 01:41:54 +0300 Subject: Add blacklist relation. In this mode blocked trades, emotes, speech text. --- src/commandhandler.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/commandhandler.cpp') 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) { -- cgit v1.2.3-60-g2f50