From 94a17bd36de15a0e8df7c7d8c62af56e0b728a8e Mon Sep 17 00:00:00 2001 From: James Allen Date: Thu, 6 Nov 2014 11:16:24 +0000 Subject: [PATCH] Remove unused socket.io endpoints --- services/web/app/coffee/router.coffee | 34 ++++++--------------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/services/web/app/coffee/router.coffee b/services/web/app/coffee/router.coffee index 8538e16bf8..250312a5d0 100644 --- a/services/web/app/coffee/router.coffee +++ b/services/web/app/coffee/router.coffee @@ -254,13 +254,6 @@ module.exports = class Router metrics.inc ('socket-io.disconnect') EditorController.leaveProject client, user - client.on 'reportError', (error, callback) -> - EditorController.reportError client, error, callback - - client.on 'sendUpdate', (doc_id, windowName, change)-> - AuthorizationManager.ensureClientCanEditProject client, (error, project_id) => - EditorUpdatesController.applyAceUpdate(client, project_id, doc_id, windowName, change) - client.on 'applyOtUpdate', (doc_id, update) -> AuthorizationManager.ensureClientCanEditProject client, (error, project_id) => EditorUpdatesController.applyOtUpdate(client, project_id, doc_id, update) @@ -269,14 +262,6 @@ module.exports = class Router AuthorizationManager.ensureClientCanViewProject client, (error, project_id) => EditorController.updateClientPosition(client, cursorData) - client.on 'addUserToProject', (email, newPrivalageLevel, callback)-> - AuthorizationManager.ensureClientCanAdminProject client, (error, project_id) => - EditorController.addUserToProject project_id, email, newPrivalageLevel, callback - - client.on 'removeUserFromProject', (user_id, callback)-> - AuthorizationManager.ensureClientCanAdminProject client, (error, project_id) => - EditorController.removeUserFromProject(project_id, user_id, callback) - client.on 'leaveDoc', (doc_id, callback)-> AuthorizationManager.ensureClientCanViewProject client, (error, project_id) => EditorController.leaveDoc(client, project_id, doc_id, callback) @@ -285,19 +270,14 @@ module.exports = class Router AuthorizationManager.ensureClientCanViewProject client, (error, project_id) => EditorController.joinDoc(client, project_id, args...) - # Deprecated and can be removed after deploying. - client.on 'pdfProject', (opts, callback)-> - AuthorizationManager.ensureClientCanViewProject client, (error, project_id) => - CompileManager.compile project_id, user._id, opts, (error, status, outputFiles) -> - return callback error, status == "success", outputFiles - - client.on 'getRootDocumentsList', (callback)-> - AuthorizationManager.ensureClientCanEditProject client, (error, project_id) => - EditorController.getListOfDocPaths project_id, callback - - client.on 'forceResyncOfDropbox', (callback)-> + # The remaining can be done via HTTP + client.on 'addUserToProject', (email, newPrivalageLevel, callback)-> AuthorizationManager.ensureClientCanAdminProject client, (error, project_id) => - EditorController.forceResyncOfDropbox project_id, callback + EditorController.addUserToProject project_id, email, newPrivalageLevel, callback + + client.on 'removeUserFromProject', (user_id, callback)-> + AuthorizationManager.ensureClientCanAdminProject client, (error, project_id) => + EditorController.removeUserFromProject(project_id, user_id, callback) client.on 'getUserDropboxLinkStatus', (owner_id, callback)-> AuthorizationManager.ensureClientCanAdminProject client, (error, project_id) =>