chainpad-server
Advanced tools
Comparing version 5.0.0 to 5.1.0
@@ -18,2 +18,4 @@ /* jshint esversion: 6 */ | ||
const ADMIN_CHANNEL_LENGTH = 33; | ||
// FIXME there are many circumstances under which call back | ||
@@ -193,2 +195,12 @@ // possible cause of a memory leak? | ||
// No userlist for admin channels (broadcast to all users) | ||
if (chan.id.length === ADMIN_CHANNEL_LENGTH) { | ||
// Join callback | ||
sendMsg(ctx, user, [seq, 'JACK', chanName]); | ||
// Send HK id | ||
preUserListFunction(); | ||
// Send your ID to complete the JOIN process | ||
return void sendMsg(ctx, user, [0, user.id, 'JOIN', chanName]); | ||
} | ||
// check whether they're in the channel | ||
@@ -446,2 +458,7 @@ var userIndex = chan.indexOf(user); | ||
Server.getChannelUserList = function (channel) { | ||
// Admin channel: broadcast to everybody without storing a userlist in memory | ||
if (channel.length === ADMIN_CHANNEL_LENGTH) { | ||
return Object.keys(ctx.users); | ||
} | ||
// "Classic" channel | ||
const chan = ctx.channels[channel] || []; | ||
@@ -448,0 +465,0 @@ return chan.map(function (user) { |
{ | ||
"name": "chainpad-server", | ||
"description": "api backend for realtime collaborative visual editor with zero knowlege server", | ||
"version": "5.0.0", | ||
"version": "5.1.0", | ||
"dependencies": { | ||
@@ -6,0 +6,0 @@ "nthen": "0.1.8", |
19421
494