Fix allow list and transfer ownership when owned pad not stored

pull/1/head
yflory 4 years ago
parent 9c8924ee27
commit d7b4fca703

@ -25,10 +25,12 @@ define([
var sframeChan = common.getSframeChannel();
var metadataMgr = common.getMetadataMgr();
var channel = data.channel;
var priv = metadataMgr.getPrivateData();
var channel = data.channel || priv.channel;
var owners = data.owners || [];
var pending_owners = data.pending_owners || [];
var teamOwner = data.teamId;
var title = opts.title;
opts = opts || {};
var redrawAll = function () {};
@ -115,7 +117,7 @@ define([
if (!friend) { return; }
common.mailbox.sendTo("RM_OWNER", {
channel: channel,
title: data.title,
title: data.title || title,
pending: pending
}, {
channel: friend.notifications,
@ -271,7 +273,7 @@ define([
href: data.href || data.rohref,
password: data.password,
path: isTemplate ? ['template'] : undefined,
title: data.title || '',
title: data.title || title || "",
teamId: obj.id
}, waitFor(function (err) {
if (err) { return void console.error(err); }
@ -320,6 +322,12 @@ define([
}));
}
}).nThen(function (waitFor) {
var href = data.href;
var hashes = priv.hashes || {};
var bestHash = hashes.editHash || hashes.viewHash || hashes.fileHash;
if (data.fakeHref) {
href = Hash.hashToHref(bestHash, priv.app);
}
sel.forEach(function (el) {
var curve = $(el).attr('data-curve');
if (curve === user.curvePublic) { return; }
@ -327,9 +335,9 @@ define([
if (!friend) { return; }
common.mailbox.sendTo("ADD_OWNER", {
channel: channel,
href: data.href,
password: data.password,
title: data.title
href: href,
password: data.password || priv.password,
title: data.title || title
}, {
channel: friend.notifications,
curvePublic: friend.curvePublic
@ -398,7 +406,8 @@ define([
var sframeChan = common.getSframeChannel();
var metadataMgr = common.getMetadataMgr();
var channel = data.channel;
var priv = metadataMgr.getPrivateData();
var channel = data.channel || priv.channel;
var owners = data.owners || [];
var restricted = data.restricted || false;
var allowed = data.allowed || [];

@ -565,7 +565,12 @@ MessengerUI, Messages) {
h('span.cp-button-name', Messages.accessButton)
]));
$accessBlock.click(function () {
Common.getSframeChannel().event('EV_ACCESS_OPEN');
var title = (config.title && config.title.getTitle && config.title.getTitle())
|| (config.title && config.title.defaultName)
|| "";
Common.getSframeChannel().event('EV_ACCESS_OPEN', {
title: title
});
});
toolbar.$bottomM.append($accessBlock);

@ -89,9 +89,10 @@ define([
};
// Access modal
create['access'] = function () {
create['access'] = function (data) {
require(['/common/inner/access.js'], function (Access) {
Access.getAccessModal(common, {
title: data.title,
onClose: function () {
hideIframe();
}

Loading…
Cancel
Save