From 47d811c90a4655b69f1846c16150efebbfa4ccfa Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 16 Feb 2015 12:27:52 +0300 Subject: Move processWhisperContinue from ea namespace into eathena and tmwa. --- src/net/ea/chathandler.cpp | 123 --------------------------------------------- src/net/ea/chathandler.h | 3 -- 2 files changed, 126 deletions(-) (limited to 'src/net/ea') diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp index 79be52a7d..08ea82980 100644 --- a/src/net/ea/chathandler.cpp +++ b/src/net/ea/chathandler.cpp @@ -24,14 +24,12 @@ #include "actormanager.h" #include "configuration.h" -#include "guildmanager.h" #include "notifymanager.h" #include "being/being.h" #include "being/playerrelations.h" #include "gui/windows/chatwindow.h" -#include "gui/windows/shopwindow.h" #include "gui/widgets/tabs/chat/gmtab.h" @@ -163,127 +161,6 @@ void ChatHandler::processWhisperResponseContinue(const uint8_t type) BLOCK_END("ChatHandler::processWhisperResponse") } -void ChatHandler::processWhisperContinue(const std::string &nick, - std::string chatMsg) -{ - // ignoring future whisper messages - if (chatMsg.find("\302\202G") == 0 || chatMsg.find("\302\202A") == 0) - { - BLOCK_END("ChatHandler::processWhisper") - return; - } - // remove first unicode space if this is may be whisper command. - if (chatMsg.find("\302\202!") == 0) - chatMsg = chatMsg.substr(2); - - if (nick != "Server") - { - if (guildManager && GuildManager::getEnableGuildBot() - && nick == "guild" && guildManager->processGuildMessage(chatMsg)) - { - BLOCK_END("ChatHandler::processWhisper") - return; - } - - if (player_relations.hasPermission(nick, PlayerRelation::WHISPER)) - { - const bool tradeBot = config.getBoolValue("tradebot"); - const bool showMsg = !config.getBoolValue("hideShopMessages"); - if (player_relations.hasPermission(nick, PlayerRelation::TRADE)) - { - if (shopWindow) - { // commands to shop from player - if (chatMsg.find("!selllist ") == 0) - { - if (tradeBot) - { - if (showMsg && chatWindow) - chatWindow->addWhisper(nick, chatMsg); - shopWindow->giveList(nick, ShopWindow::SELL); - } - } - else if (chatMsg.find("!buylist ") == 0) - { - if (tradeBot) - { - if (showMsg && chatWindow) - chatWindow->addWhisper(nick, chatMsg); - shopWindow->giveList(nick, ShopWindow::BUY); - } - } - else if (chatMsg.find("!buyitem ") == 0) - { - if (showMsg && chatWindow) - chatWindow->addWhisper(nick, chatMsg); - if (tradeBot) - { - shopWindow->processRequest(nick, chatMsg, - ShopWindow::BUY); - } - } - else if (chatMsg.find("!sellitem ") == 0) - { - if (showMsg && chatWindow) - chatWindow->addWhisper(nick, chatMsg); - if (tradeBot) - { - shopWindow->processRequest(nick, chatMsg, - ShopWindow::SELL); - } - } - else if (chatMsg.length() > 3 - && chatMsg.find("\302\202") == 0) - { - chatMsg = chatMsg.erase(0, 2); - if (showMsg && chatWindow) - chatWindow->addWhisper(nick, chatMsg); - if (chatMsg.find("B1") == 0 || chatMsg.find("S1") == 0) - shopWindow->showList(nick, chatMsg); - } - else if (chatWindow) - { - chatWindow->addWhisper(nick, chatMsg); - } - } - else if (chatWindow) - { - chatWindow->addWhisper(nick, chatMsg); - } - } - else - { - if (chatWindow && (showMsg || (chatMsg.find("!selllist") != 0 - && chatMsg.find("!buylist") != 0))) - { - chatWindow->addWhisper(nick, chatMsg); - } - } - } - } - else if (localChatTab) - { - if (gmChatTab && strStartWith(chatMsg, "[GM] ")) - { - chatMsg = chatMsg.substr(5); - const size_t pos = chatMsg.find(": ", 0); - if (pos == std::string::npos) - { - gmChatTab->chatLog(chatMsg); - } - else - { - gmChatTab->chatLog(chatMsg.substr(0, pos), - chatMsg.substr(pos + 2)); - } - } - else - { - localChatTab->chatLog(chatMsg, ChatMsgType::BY_SERVER); - } - } - BLOCK_END("ChatHandler::processWhisper") -} - void ChatHandler::processBeingChat(Net::MessageIn &msg) { if (!actorManager) diff --git a/src/net/ea/chathandler.h b/src/net/ea/chathandler.h index b5f77eb64..6ca511b4b 100644 --- a/src/net/ea/chathandler.h +++ b/src/net/ea/chathandler.h @@ -58,9 +58,6 @@ class ChatHandler notfinal : public Net::ChatHandler void clear() override final; - static void processWhisperContinue(const std::string &nick, - std::string chatMsg); - static void processWhisperResponseContinue(const uint8_t type); protected: -- cgit v1.2.3-70-g09d2