From 041a5a85ba09650a85f3ac7a3e88e183c6b88c28 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 13 Oct 2014 19:46:57 +0300 Subject: eathena: show error for non existing channel in channel tab. --- src/net/eathena/chathandler.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/net/eathena/chathandler.cpp') diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp index dd4618482..0a5029b6e 100644 --- a/src/net/eathena/chathandler.cpp +++ b/src/net/eathena/chathandler.cpp @@ -37,6 +37,7 @@ #include "resources/chatobject.h" +#include "utils/gettext.h" #include "utils/stringutils.h" #include @@ -503,6 +504,21 @@ void ChatHandler::processWhisperResponse(Net::MessageIn &msg) const uint8_t type = msg.readUInt8("response"); msg.readInt32("unknown"); + if (type == 1 && chatWindow) + { + const std::string nick = getLastWhisperNick(); + if (nick.size() > 1 && nick[0] == '#') + { + chatWindow->channelChatLog(nick, + // TRANSLATORS: chat message + strprintf(_("Message could not be sent, channel " + "%s is not exists."), nick.c_str()), + ChatMsgType::BY_SERVER, false, false); + if (!mSentWhispers.empty()) + mSentWhispers.pop(); + return; + } + } processWhisperResponseContinue(type); } -- cgit v1.2.3-60-g2f50