summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorWu Cheng-Han2016-07-30 11:29:03 +0800
committerWu Cheng-Han2016-07-30 11:29:03 +0800
commitd4804f7aa579ac90776c6c544dd8c1b29beefdc8 (patch)
treefdd3fa147a72f4fb018d7399c21c0d9fb34fbaa9 /lib
parenta14e7953b5a2196eda001229d44ebb2e9c18fe7c (diff)
Fix user color is not following the author color
Diffstat (limited to '')
-rw-r--r--lib/realtime.js4
1 files changed, 4 insertions, 0 deletions
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);