I am trying to call
nodejs_get_content_channel_users('jamio');
and in my console I receive the error:
getContentTokensUsers: Invalid JSON "{"channel":"jamio"}" [TypeError: Cannot read property 'sockets' of undefined]
I have console.log-ed my way through the code and it seems the culprit function is in server.js about line 480:
var getContentTokenChannelUsers = function (channel) {
var users = {uids: [], authTokens: []};
for (var sessionId in tokenChannels[channel].sockets) {
if (io.sockets.sockets[sessionId].uid) {
users.uids.push(io.sockets.sockets[sessionId].uid);
}
else {
users.authTokens.push(io.sockets.sockets[sessionId].authToken);
}
}
return users;
}I really don't understand what this code is supposed to do other than loop through the users and emit their existance.