group join leave, and updating

This commit is contained in:
Julian Lam
2013-09-03 16:05:01 -04:00
parent 03fb649274
commit f39932ece7
5 changed files with 97 additions and 8 deletions

View File

@@ -822,6 +822,20 @@ var SocketIO = require('socket.io').listen(global.server, {
callback(err ? err.message : null, groupObj || undefined);
});
});
socket.on('api:groups.join', function(data, callback) {
Groups.join(data.gid, data.uid, callback);
});
socket.on('api:groups.leave', function(data, callback) {
Groups.leave(data.gid, data.uid, callback);
});
socket.on('api:groups.update', function(data, callback) {
Groups.update(data.gid, data.values, function(err) {
callback(err ? err.message : null);
});
});
});
}(SocketIO));