From bc3fe4f32cc9abf2e78c0010d0339e3e8add4a87 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 20 Mar 2018 11:14:55 +0100 Subject: [PATCH 1/4] update version in footer and package.json --- customize.dist/pages.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/customize.dist/pages.js b/customize.dist/pages.js index e8f8c877c..4cd4f49f4 100644 --- a/customize.dist/pages.js +++ b/customize.dist/pages.js @@ -72,7 +72,7 @@ define([ ]) ]) ]), - h('div.cp-version-footer', "CryptPad v1.27.0 (null)") + h('div.cp-version-footer', "CryptPad v1.28.0 (toString)") ]); }; diff --git a/package.json b/package.json index e94c51a14..81814548c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "cryptpad", "description": "realtime collaborative visual editor with zero knowlege server", - "version": "1.27.0", + "version": "1.28.0", "license": "AGPL-3.0-or-later", "dependencies": { "chainpad-server": "^2.0.0", From ed8f9e4e3f652596239364705472a69d6dee4b90 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 20 Mar 2018 11:15:44 +0100 Subject: [PATCH 2/4] remove XXX after review --- rpc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpc.js b/rpc.js index 9cdb440f3..163d745cf 100644 --- a/rpc.js +++ b/rpc.js @@ -1043,7 +1043,7 @@ var owned_upload_complete = function (Env, safeKey, cb) { Mkdirp(plannedPath, w(function (e /*, path */) { if (e) { // does not throw error if the directory already existed w.abort(); - return void cb(e); // XXX do we export Errors or strings? + return void cb(e); } })); }).nThen(function (w) { From 7c072aeccb3f35c8280689f58397eb1d56dd60ab Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 20 Mar 2018 11:16:18 +0100 Subject: [PATCH 3/4] add remove-pins rpc --- rpc.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/rpc.js b/rpc.js index 163d745cf..ae4971ae0 100644 --- a/rpc.js +++ b/rpc.js @@ -837,6 +837,17 @@ var removeOwnedChannel = function (Env, channelId, unsafeKey, cb) { }); }; +/* Users should be able to clear their own pin log with an authenticated RPC +*/ +var removePins = function (Env, safeKey, cb) { + if (typeof(Env.pinStore.removeChannel) !== 'function') { + return void cb("E_NOT_IMPLEMENTED"); + } + Env.pinStore.removeChannel(safeKey, function (err) { + cb(err); + }); +}; + var upload = function (Env, publicKey, content, cb) { var paths = Env.paths; var dec; @@ -1153,6 +1164,7 @@ var isAuthenticatedCall = function (call) { 'EXPIRE_SESSION', 'CLEAR_OWNED_CHANNEL', 'REMOVE_OWNED_CHANNEL', + 'REMOVE_PINS', ].indexOf(call) !== -1; }; @@ -1445,6 +1457,11 @@ RPC.create = function ( if (e) { return void Respond(e); } Respond(void 0, "OK"); }); + case 'REMOVE_PINS': + return void removePins(Env, safeKey, function (e, response) { + if (e) { return void Respond(e); } + Respond(void 0, response); + }); // restricted to privileged users... case 'UPLOAD': if (!privileged) { return deny(); } From 8230c471cd194974609853981eee4835144486d1 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 20 Mar 2018 11:31:37 +0100 Subject: [PATCH 4/4] add npm dependency for sortify --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 81814548c..7f19ca955 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "pull-stream": "^3.6.1", "replify": "^1.2.0", "saferphore": "0.0.1", + "sortify": "^1.0.4", "stream-to-pull-stream": "^1.7.2", "tweetnacl": "~0.12.2", "ws": "^1.0.1"