client loads messages using the new client loads messages using new method, getChatMessages restructured and renamed to getLastChatMessages, added GET_CHAT_MESSAGES, getChatMessages restructured and renamed to getLastChatMessages

This commit is contained in:
mluto 2013-01-06 16:11:48 +01:00
parent 9484b92ae2
commit 5592c4b0fe
5 changed files with 108 additions and 47 deletions

View file

@ -400,7 +400,19 @@ function getCollabClient(ace2editor, serverVars, initialUserInfo, options, _pad)
}
else if (msg.type == "CHAT_MESSAGE")
{
chat.addMessage(msg, true);
chat.addMessage(msg, true, false);
}
else if (msg.type == "CHAT_MESSAGES")
{
for(var i = msg.messages.length - 1; i >= 0; i--)
{
chat.addMessage(msg.messages[i], true, true);
}
if(!chat.gotInitalMessages)
{
chat.scrollDown();
chat.gotInitalMessages = true;
}
}
else if (msg.type == "SERVER_MESSAGE")
{