summaryrefslogtreecommitdiff
path: root/src/net/chathandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/chathandler.cpp')
-rw-r--r--src/net/chathandler.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/net/chathandler.cpp b/src/net/chathandler.cpp
index d8a228ea..d3dcd2b1 100644
--- a/src/net/chathandler.cpp
+++ b/src/net/chathandler.cpp
@@ -70,7 +70,7 @@ void ChatHandler::handleMessage(MessageIn &msg)
short channelId;
std::string userNick;
std::string channelName;
- //Sint16 chatMsgLength;
+ short error = -1;
switch (msg.getId())
{
@@ -88,7 +88,8 @@ void ChatHandler::handleMessage(MessageIn &msg)
}
break;
case CPMSG_REGISTER_CHANNEL_RESPONSE:
- if(msg.readInt8() == ERRMSG_OK)
+ error = msg.readInt8();
+ if(error == ERRMSG_OK)
{
channelId = msg.readInt16();
std::string channelName = msg.readString();
@@ -98,7 +99,14 @@ void ChatHandler::handleMessage(MessageIn &msg)
}
else
{
- chatWindow->chatLog("Error registering channel", BY_SERVER);
+ if (error == ERRMSG_INVALID_ARGUMENT)
+ {
+ chatWindow->chatLog("Error registering channel - Invalid Channel Name given", BY_SERVER);
+ }
+ else
+ {
+ chatWindow->chatLog("Error registering channel", BY_SERVER);
+ }
}
break;
case CPMSG_ENTER_CHANNEL_RESPONSE: