summaryrefslogtreecommitdiff
path: root/src/net/chathandler.cpp
diff options
context:
space:
mode:
authorDavid Athay <ko2fan@gmail.com>2008-04-18 15:23:49 +0000
committerDavid Athay <ko2fan@gmail.com>2008-04-18 15:23:49 +0000
commit4371c8c1ffcf24e8d5a7cf2ec126be239cab3d76 (patch)
tree831d9d2e909dabab0ee2c6ed640e290ee28ad294 /src/net/chathandler.cpp
parent0b567928c0a24c7346451b59285ce8144ae0bf2e (diff)
downloadmana-client-4371c8c1ffcf24e8d5a7cf2ec126be239cab3d76.tar.gz
mana-client-4371c8c1ffcf24e8d5a7cf2ec126be239cab3d76.tar.bz2
mana-client-4371c8c1ffcf24e8d5a7cf2ec126be239cab3d76.tar.xz
mana-client-4371c8c1ffcf24e8d5a7cf2ec126be239cab3d76.zip
Fixed numerous crashes with chat and guild windows using new tabbed area.
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: