Merge pull request #724 from fourplusone/fix/fix-722-develop

fix #722 in the develop branch
pull/735/head
John McLear 2012-05-22 05:31:25 -07:00
commit c30d2fde96
1 changed files with 19 additions and 25 deletions

View File

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