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

@@ -201,6 +201,34 @@ define([
}
};
// Incoming edit rights request: add data before sending it to inner
handlers['REQUEST_PAD_ACCESS'] = function (ctx, box, data, hash) {
var msg = data.msg;
var hash = data.hash;
var content = msg.content;
if (msg.author !== content.user.curvePublic) { return void cb(true); }
var channel = content.channel;
var res = ctx.store.manager.findChannel(channel);
if (!res.length) { return void cb(true); }
var edPublic = store.proxy.edPublic;
var title;
if (!res.some(functon (obj) {
if (obj.data &&
Array.isArray(obj.data.owners) && obj.data.owners.indexOf(edPublic) !== -1 &&
obj.data.href) {
title = obj.data.filename || obj.data.title;
return true;
}
})) { return void cb(true); }
content.title = title;
});
return {
add: function (ctx, box, data, cb) {
/**