Checking if the author for the sessions match instead of comparing the entire session.

pull/2180/head
Mike DeRosa 2014-07-12 16:40:59 -04:00
parent 7861cae763
commit 25f6c9bf9a
1 changed files with 1 additions and 1 deletions

View File

@ -871,7 +871,7 @@ function handleSwitchToPad(client, message)
var roomClients = socketio.sockets.clients(padId);
for(var i = 0; i < roomClients.length; i++) {
var sinfo = sessioninfos[roomClients[i].id];
if(sinfo && sinfo == currentSession) {
if(sinfo && sinfo.author == currentSession.author) {
// fix user's counter, works on page refresh or if user closes browser window and then rejoins
sessioninfos[roomClients[i].id] = {};
roomClients[i].leave(padId);