diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-10-13 19:46:57 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-10-13 20:20:41 +0300 |
commit | 041a5a85ba09650a85f3ac7a3e88e183c6b88c28 (patch) | |
tree | 339c55634ac1578807921136bd64acf3e57b6aac /src/net/ea | |
parent | f2a4cf2dde41017c199cdf51044180df6e6ff193 (diff) | |
download | plus-041a5a85ba09650a85f3ac7a3e88e183c6b88c28.tar.gz plus-041a5a85ba09650a85f3ac7a3e88e183c6b88c28.tar.bz2 plus-041a5a85ba09650a85f3ac7a3e88e183c6b88c28.tar.xz plus-041a5a85ba09650a85f3ac7a3e88e183c6b88c28.zip |
eathena: show error for non existing channel in channel tab.
Diffstat (limited to 'src/net/ea')
-rw-r--r-- | src/net/ea/chathandler.cpp | 17 | ||||
-rw-r--r-- | src/net/ea/chathandler.h | 4 |
2 files changed, 20 insertions, 1 deletions
diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp index 0f5ae0f36..4e5d2300b 100644 --- a/src/net/ea/chathandler.cpp +++ b/src/net/ea/chathandler.cpp @@ -82,7 +82,7 @@ void ChatHandler::talkPet(const std::string &restrict text, talk(action, channel); } -void ChatHandler::processWhisperResponseContinue(const uint8_t type) +std::string ChatHandler::getPopLastWhisperNick() { std::string nick; if (mSentWhispers.empty()) @@ -94,7 +94,22 @@ void ChatHandler::processWhisperResponseContinue(const uint8_t type) nick = mSentWhispers.front(); mSentWhispers.pop(); } + return nick; +} + +std::string ChatHandler::getLastWhisperNick() +{ + std::string nick; + if (mSentWhispers.empty()) + nick = "user"; + else + nick = mSentWhispers.front(); + return nick; +} +void ChatHandler::processWhisperResponseContinue(const uint8_t type) +{ + const std::string nick = getPopLastWhisperNick(); switch (type) { case 0x00: diff --git a/src/net/ea/chathandler.h b/src/net/ea/chathandler.h index 810ca7efa..80cf6afbb 100644 --- a/src/net/ea/chathandler.h +++ b/src/net/ea/chathandler.h @@ -62,6 +62,10 @@ class ChatHandler notfinal : public Net::ChatHandler void processWhisperResponseContinue(const uint8_t type); protected: + std::string getPopLastWhisperNick(); + + std::string getLastWhisperNick(); + typedef std::queue<std::string> WhisperQueue; WhisperQueue mSentWhispers; int mMotdTime; |