diff --git a/src/socket.io/index.js b/src/socket.io/index.js index e17c3acd34..f382d81f50 100644 --- a/src/socket.io/index.js +++ b/src/socket.io/index.js @@ -147,6 +147,7 @@ Sockets.init = function() { server: io, userSockets: userSockets }, + signatureLen = methodToCall.length, socketArgs = []; // Construct the arguments that'll get passed into each socket method @@ -156,6 +157,10 @@ Sockets.init = function() { if (callback !== undefined) { socketArgs.push(callback); } + + // Do not execute the requested method if the signature is not correct + console.log('expecting', signatureLen, 'sending', socketArgs.length); + socketArgs.push(sessionData); // Call the requested method @@ -166,6 +171,11 @@ Sockets.init = function() { } else { methodToCall.apply(Namespaces, socketArgs); } + // } catch (err) { + // console.log('HEREHEHREH'); + // winston.error('[socket.io] Error executing socket method (' + payload.name + '). Dropping.'); + // winston.error('[socket.io] ' + err.message); + // } // winston.info('[socket.io] Executing: ' + payload.name); } else { winston.warn('[socket.io] Unrecognized message: ' + payload.name); diff --git a/src/socket.io/topics.js b/src/socket.io/topics.js index 1f4c2087bf..9b8f6be65c 100644 --- a/src/socket.io/topics.js +++ b/src/socket.io/topics.js @@ -175,8 +175,8 @@ SocketTopics.movePost = function(data, callback, sessionData) { }); }; -SocketTopics.move = function(data) { - threadTools.move(data.tid, data.cid, socket); +SocketTopics.move = function(data, sessionData) { + threadTools.move(data.tid, data.cid, sessionData.socket); }; SocketTopics.followCheck = function(tid, callback, sessionData) { diff --git a/src/upgrade.js b/src/upgrade.js index 4fa575b70e..e015625010 100644 --- a/src/upgrade.js +++ b/src/upgrade.js @@ -385,7 +385,6 @@ Upgrade.upgrade = function(callback) { updatesMade = true; db.getObjectValues('username:uid', function(err, uids) { - console.log(uids); async.eachSeries(uids, function(uid, next) { Groups.joinByGroupName('registered-users', uid, next); }, function(err) {