From c640c550fd80b8f779d469bf55a1446f14f0c8f1 Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Wed, 23 Oct 2013 15:12:19 -0400 Subject: [PATCH] removed old browsing code from websockets.js --- src/websockets.js | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/websockets.js b/src/websockets.js index 0aadc0abe4..36df253f1a 100644 --- a/src/websockets.js +++ b/src/websockets.js @@ -168,27 +168,10 @@ module.exports.init = function(io) { var anonymousCount = getAnonymousCount(roomName); - function userList(users, anonymousCount, userCount) { - var usernames = []; - - for (var i = 0, ii = users.length; i < ii; ++i) { - usernames[i] = '' + '' + users[i].username + ''; - } - - var joiner = anonymousCount + userCount == 1 ? 'is' : 'are', - userList = anonymousCount > 0 ? usernames.concat(util.format('%d guest%s', anonymousCount, anonymousCount > 1 ? 's' : '')) : usernames, - lastUser = userList.length > 1 ? ' and ' + userList.pop() : ''; - - return util.format('%s%s %s browsing this thread', userList.join(', '), lastUser, joiner); - } - - if (uids.length === 0) { io.sockets. in (roomName).emit('api:get_users_in_room', { users: [], anonymousCount:0 }); } else { user.getMultipleUserFields(uids, ['uid', 'username', 'userslug', 'picture'], function(err, users) { - //if (!err) - //io.sockets. in (roomName).emit('api:get_users_in_room', userList(users, anonymousCount, users.length)); if(!err) io.sockets. in (roomName).emit('api:get_users_in_room', { users: users, anonymousCount:anonymousCount }); });