request capabilities temp

This commit is contained in:
yflory
2019-07-11 14:16:04 +02:00
parent df5090eaef
commit 6f1e281cf8
9 changed files with 166 additions and 2 deletions

View File

@@ -2,9 +2,10 @@ define([
'jquery',
'/common/hyperscript.js',
'/common/common-hash.js',
'/common/common-interface.js',
'/common/common-ui-elements.js',
'/customize/messages.js',
], function ($, h, Hash, UIElements, Messages) {
], function ($, h, Hash, UI, UIElements, Messages) {
var handlers = {};
@@ -84,12 +85,36 @@ define([
key: 'newPadPassword',
value: msg.content.password
}, todo);
common.mailbox.dismiss(data, function (err) {
if (err) { return void console.error(err); }
});
};
if (!content.archived) {
content.dismissHandler = defaultDismiss(common, data);
}
};
handlers['REQUEST_PAD_ACCESS'] = function (common, data) {
var content = data.content;
var msg = content.msg;
// Check authenticity
if (msg.author !== msg.content.user.curvePublic) { return; }
// Display the notification
content.getFormatText = function () {
return 'Edit access request: ' + msg.content.channel + ' - ' + msg.content.user.displayName;
};
// if not archived, add handlers
content.handler = function () {
UI.confirm("Give edit rights?", function (yes) {
if (!yes) { return; }
// XXX Command to worker to get the edit href and send it to msg.content.user
});
};
};
return {
add: function (common, data) {
var type = data.content.msg.type;