|
|
@ -203,25 +203,53 @@ define([
|
|
|
|
if (ed === edPublic) { me = true; }
|
|
|
|
if (ed === edPublic) { me = true; }
|
|
|
|
return ed;
|
|
|
|
return ed;
|
|
|
|
}).filter(function (x) { return x; });
|
|
|
|
}).filter(function (x) { return x; });
|
|
|
|
|
|
|
|
NThen(function (waitFor) {
|
|
|
|
|
|
|
|
var msg = me ?
|
|
|
|
|
|
|
|
"Are you sure? You're going to give up on your rights, this can't be undone!" :
|
|
|
|
|
|
|
|
"Are you sure?"; // XXX
|
|
|
|
|
|
|
|
UI.confirm(msg, waitFor(function (yes) {
|
|
|
|
|
|
|
|
if (!yes) {
|
|
|
|
|
|
|
|
waitFor.abort();
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
}).nThen(function (waitFor) {
|
|
|
|
// Send the command
|
|
|
|
// Send the command
|
|
|
|
var send = function () {
|
|
|
|
|
|
|
|
sframeChan.query('Q_SET_PAD_METADATA', {
|
|
|
|
sframeChan.query('Q_SET_PAD_METADATA', {
|
|
|
|
channel: channel,
|
|
|
|
channel: channel,
|
|
|
|
command: pending ? 'RM_PENDING_OWNERS' : 'RM_OWNERS',
|
|
|
|
command: pending ? 'RM_PENDING_OWNERS' : 'RM_OWNERS',
|
|
|
|
value: toRemove
|
|
|
|
value: toRemove
|
|
|
|
}, function (err, res) {
|
|
|
|
}, waitFor(function (err, res) {
|
|
|
|
err = err || (res && res.error);
|
|
|
|
err = err || (res && res.error);
|
|
|
|
if (err) { return void UI.warn('ERROR' + err); } // XXX
|
|
|
|
if (err) {
|
|
|
|
redrawAll();
|
|
|
|
waitFor.abort();
|
|
|
|
|
|
|
|
return void UI.warn('ERROR' + err);
|
|
|
|
|
|
|
|
} // XXX
|
|
|
|
UI.log('DONE'); // XXX
|
|
|
|
UI.log('DONE'); // XXX
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
}).nThen(function (waitFor) {
|
|
|
|
|
|
|
|
sel.forEach(function (el) {
|
|
|
|
|
|
|
|
var friend = friends[$(el).attr('data-curve')];
|
|
|
|
|
|
|
|
if (!friend) { return; }
|
|
|
|
|
|
|
|
common.mailbox.sendTo("RM_OWNER", {
|
|
|
|
|
|
|
|
channel: channel,
|
|
|
|
|
|
|
|
title: data.title,
|
|
|
|
|
|
|
|
pending: pending,
|
|
|
|
|
|
|
|
user: {
|
|
|
|
|
|
|
|
displayName: user.name,
|
|
|
|
|
|
|
|
avatar: user.avatar,
|
|
|
|
|
|
|
|
profile: user.profile,
|
|
|
|
|
|
|
|
notifications: user.notifications,
|
|
|
|
|
|
|
|
curvePublic: user.curvePublic,
|
|
|
|
|
|
|
|
edPublic: priv.edPublic
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
channel: friend.notifications,
|
|
|
|
|
|
|
|
curvePublic: friend.curvePublic
|
|
|
|
|
|
|
|
}, waitFor());
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
}).nThen(function () {
|
|
|
|
var msg = me ?
|
|
|
|
redrawAll();
|
|
|
|
"Are you sure? You're going to give up on your rights, this can't be undone!" :
|
|
|
|
|
|
|
|
"Are you sure?"; // XXX
|
|
|
|
|
|
|
|
UI.confirm(msg, function (yes) {
|
|
|
|
|
|
|
|
if (!yes) { return; }
|
|
|
|
|
|
|
|
send();
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
$div.append(h('p', removeButton));
|
|
|
|
$div.append(h('p', removeButton));
|
|
|
|