Fix handleClientMessage_USER_* payloads not containing user info

pull/2866/head
Mikk Andresen 2015-12-31 14:19:23 +02:00
parent 4ad759dd25
commit aab7186486
1 changed files with 10 additions and 4 deletions

View File

@ -414,6 +414,12 @@ function getCollabClient(ace2editor, serverVars, initialUserInfo, options, _pad)
{
callbacks.onServerMessage(msg.payload);
}
//HACKISH: User messages do not have "payload" but "userInfo", so that all "handleClientMessage_USER_" hooks would work, populate payload
//FIXME: USER_* messages to have "payload" property instead of "userInfo", seems like a quite a big work
if(msg.type.indexOf("USER_") > -1) {
msg.payload = msg.userInfo;
}
hooks.callAll('handleClientMessage_' + msg.type, {payload: msg.payload});
}