Fix user color is not following the author color

This commit is contained in:
Wu Cheng-Han 2016-07-30 11:29:03 +08:00
parent a14e7953b5
commit d4804f7aa5

View file

@ -368,6 +368,10 @@ function finishConnection(socket, note, user) {
return failConnection(403, 'connection forbidden', socket);
}
}
// update user color to author color
if (note.authors[user.userid]) {
user.color = users[socket.id].color = note.authors[user.userid].color;
}
note.users[socket.id] = user;
note.socks.push(socket);
note.server.addClient(socket);