fix #722 by better argument checking in PadMessageHandler.js

pull/724/head
Matthias Bartelmeß 2012-05-22 09:31:28 +02:00
parent 185a3bface
commit 06c36f3023
1 changed files with 19 additions and 25 deletions

View File

@ -177,31 +177,25 @@ exports.handleMessage = function(client, message)
{
handleClientReady(client, message);
}
else if(message.type == "COLLABROOM" &&
message.data.type == "USER_CHANGES")
{
handleUserChanges(client, message);
}
else if(message.type == "COLLABROOM" &&
message.data.type == "USERINFO_UPDATE")
{
handleUserInfoUpdate(client, message);
}
else if(message.type == "COLLABROOM" &&
message.data.type == "CHAT_MESSAGE")
{
handleChatMessage(client, message);
}
else if(message.type == "COLLABROOM" &&
message.data.type == "SAVE_REVISION")
{
handleSaveRevisionMessage(client, message);
}
else if(message.type == "COLLABROOM" &&
message.data.type == "CLIENT_MESSAGE" &&
message.data.payload.type == "suggestUserName")
{
handleSuggestUserName(client, message);
else if(message.type == "COLLABROOM" && typeof message.data == 'object'){
if (message.data.type == "USER_CHANGES")
{
handleUserChanges(client, message);
}
else if (message.data.type == "USERINFO_UPDATE")
{
handleUserInfoUpdate(client, message);
}
else if(message.data.type == "CHAT_MESSAGE")
{
handleChatMessage(client, message);
}
else if(message.data.type == "CLIENT_MESSAGE" &&
typeof message.data.payload == 'object' &&
message.data.payload.type == "suggestUserName")
{
handleSuggestUserName(client, message);
}
}
//if the message type is unknown, throw an exception
else