From d4804f7aa579ac90776c6c544dd8c1b29beefdc8 Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Sat, 30 Jul 2016 11:29:03 +0800 Subject: [PATCH] Fix user color is not following the author color --- lib/realtime.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/realtime.js b/lib/realtime.js index 7e93f20a..1c99f02e 100644 --- a/lib/realtime.js +++ b/lib/realtime.js @@ -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);