From cdda692492c1655af58ca40b7f7fd30671b8699a Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 25 Nov 2020 15:14:33 +0100 Subject: [PATCH 1/4] Fix duplicate friend data --- www/common/common-messaging.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/www/common/common-messaging.js b/www/common/common-messaging.js index 15d0408f7..65f05961e 100644 --- a/www/common/common-messaging.js +++ b/www/common/common-messaging.js @@ -91,7 +91,7 @@ define([ Msg.updateMyData = function (store, curve) { var myData = createData(store.proxy, false); if (store.proxy.friends) { - store.proxy.friends.me = myData; + store.proxy.friends.me = Util.clone(myData); delete store.proxy.friends.me.channel; } if (store.modules['team']) { @@ -99,6 +99,7 @@ define([ } var todo = function (friend) { if (!friend || !friend.notifications) { return; } + delete friend.user; myData.channel = friend.channel; store.mailbox.sendTo('UPDATE_DATA', myData, { channel: friend.notifications, From 9fe36d5c931f7ce5616e5b350cfddcfb356fa081 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Benqu=C3=A9?= Date: Wed, 25 Nov 2020 15:53:59 +0000 Subject: [PATCH 2/4] Remove Document ID hard-coded key --- www/common/inner/properties.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/common/inner/properties.js b/www/common/inner/properties.js index 143c32d81..d3969b028 100644 --- a/www/common/inner/properties.js +++ b/www/common/inner/properties.js @@ -12,7 +12,7 @@ define([ Messages, nThen) { var Properties = {}; - Messages.documentID = Messages.documentID || 'Document identifier'; // XXX + Messages.documentID = Messages.documentID; var getPadProperties = function (Env, data, opts, _cb) { var cb = Util.once(Util.mkAsync(_cb)); From 2f062de290bec32026f4329e83ed994641b84388 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Benqu=C3=A9?= Date: Wed, 25 Nov 2020 17:02:39 +0000 Subject: [PATCH 3/4] Add archived alert message --- www/admin/inner.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/www/admin/inner.js b/www/admin/inner.js index d9bebc097..7b88fcbdf 100644 --- a/www/admin/inner.js +++ b/www/admin/inner.js @@ -120,7 +120,8 @@ define([ Messages.admin_archiveInput = "Document URL"; Messages.admin_archiveInput2 = "Document password"; Messages.admin_archiveInval = "Invalid document"; - Messages.restoredFromServer = "Pad restored"; + Messages.restoredFromServer = "Document restored"; + Messages.archivedFromServer = "Document archived"; var archiveForm = function (archive, $div, $button) { var label = h('label', { for: 'cp-admin-archive' }, Messages.admin_archiveInput); @@ -221,7 +222,7 @@ define([ console.error(e); return; } - UI.log(archive ? Messages.deletedFromServer : Messages.restoredFromServer); + UI.log(archive ? Messages.archivedFromServer : Messages.restoredFromServer); $input.val(''); $pwInput.val(''); }); From 5f67038dad12d1069b955681882d3eff2bd68014 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 4 Dec 2020 11:15:22 +0100 Subject: [PATCH 4/4] Provide pathname to sframe-common-outer --- www/common/sframe-common-outer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/common/sframe-common-outer.js b/www/common/sframe-common-outer.js index d17924cf0..e008681fc 100644 --- a/www/common/sframe-common-outer.js +++ b/www/common/sframe-common-outer.js @@ -8,7 +8,7 @@ define([ ], function (nThen, ApiConfig, RequireConfig, Messages, $) { var common = {}; - common.initIframe = function (waitFor, isRt) { + common.initIframe = function (waitFor, isRt, pathname) { var requireConfig = RequireConfig(); var lang = Messages._languageUsed; var req = { @@ -31,7 +31,7 @@ define([ } document.getElementById('sbox-iframe').setAttribute('src', - ApiConfig.httpSafeOrigin + window.location.pathname + 'inner.html?' + + ApiConfig.httpSafeOrigin + (pathname || window.location.pathname) + 'inner.html?' + requireConfig.urlArgs + '#' + encodeURIComponent(JSON.stringify(req))); // This is a cheap trick to avoid loading sframe-channel in parallel with the