From 51ac76e8effd03b968a142b7bd900584d5942a59 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 7 Sep 2014 17:09:47 +0300 Subject: split processWhisperResponse into two functions with net code and without. --- src/net/ea/chathandler.cpp | 7 ++++++- src/net/ea/chathandler.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src/net/ea') diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp index 52e9a7873..6e6b9927e 100644 --- a/src/net/ea/chathandler.cpp +++ b/src/net/ea/chathandler.cpp @@ -87,6 +87,12 @@ void ChatHandler::processWhisperResponse(Net::MessageIn &msg) { BLOCK_START("ChatHandler::processWhisperResponse") + const uint8_t type = msg.readUInt8("response"); + processWhisperResponseContinue(type); +} + +void ChatHandler::processWhisperResponseContinue(const uint8_t type) +{ std::string nick; if (mSentWhispers.empty()) { @@ -98,7 +104,6 @@ void ChatHandler::processWhisperResponse(Net::MessageIn &msg) mSentWhispers.pop(); } - const uint8_t type = msg.readUInt8("response"); switch (type) { case 0x00: diff --git a/src/net/ea/chathandler.h b/src/net/ea/chathandler.h index 338d49b44..e33b2433a 100644 --- a/src/net/ea/chathandler.h +++ b/src/net/ea/chathandler.h @@ -61,6 +61,8 @@ class ChatHandler notfinal : public Net::ChatHandler void processWhisperContinue(const std::string &nick, std::string chatMsg) const; + void processWhisperResponseContinue(const uint8_t type); + protected: typedef std::queue WhisperQueue; WhisperQueue mSentWhispers; -- cgit v1.2.3-70-g09d2