diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 773bc36a8..b3e03bb7d 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -509,7 +509,7 @@ define([ if (data.href || data.roHref) { parsed = Hash.parsePadUrl(data.href || data.roHref); } - if (owned && data.roHref && parsed.type !== 'drive' && parsed.hashData.type === 'pad') { + if (owned && parsed.hashData.type === 'pad') { var manageOwners = h('button.no-margin', Messages.owner_openModalButton); $(manageOwners).click(function () { data.teamId = typeof(owned) !== "boolean" ? owned : undefined; diff --git a/www/common/sframe-common-outer.js b/www/common/sframe-common-outer.js index e919f1506..bffe150c3 100644 --- a/www/common/sframe-common-outer.js +++ b/www/common/sframe-common-outer.js @@ -495,18 +495,25 @@ define([ }); sframeChan.on('Q_ACCEPT_OWNERSHIP', function (data, cb) { - var _data = { - password: data.password, - href: data.href, - channel: data.channel, - title: data.title, - owners: data.metadata.owners, - expire: data.metadata.expire, - forceSave: true - }; - Cryptpad.setPadTitle(_data, function (err) { - cb({error: err}); - }); + var parsed = Utils.Hash.parsePadUrl(data.href); + if (parsed.type === 'drive') { + // Shared folder + var secret = Utils.Hash.getSecrets(parsed.type, parsed.hash, data.password); + Cryptpad.addSharedFolder(null, secret, cb); + } else { + var _data = { + password: data.password, + href: data.href, + channel: data.channel, + title: data.title, + owners: data.metadata.owners, + expire: data.metadata.expire, + forceSave: true + }; + Cryptpad.setPadTitle(_data, function (err) { + cb({error: err}); + }); + } // Also add your mailbox to the metadata object var padParsed = Utils.Hash.parsePadUrl(data.href);