diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-02-16 12:27:52 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-02-16 12:27:52 +0300 |
commit | 47d811c90a4655b69f1846c16150efebbfa4ccfa (patch) | |
tree | 6624874f4da16cb900fc7aa730e5b0ccde4a0c9f /src/net/ea/chathandler.cpp | |
parent | 08fbe14b1b261b5652f90212fd268d371302e762 (diff) | |
download | manaplus-47d811c90a4655b69f1846c16150efebbfa4ccfa.tar.gz manaplus-47d811c90a4655b69f1846c16150efebbfa4ccfa.tar.bz2 manaplus-47d811c90a4655b69f1846c16150efebbfa4ccfa.tar.xz manaplus-47d811c90a4655b69f1846c16150efebbfa4ccfa.zip |
Move processWhisperContinue from ea namespace into eathena and tmwa.
Diffstat (limited to 'src/net/ea/chathandler.cpp')
-rw-r--r-- | src/net/ea/chathandler.cpp | 123 |
1 files changed, 0 insertions, 123 deletions
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) |