Support mailbox in the support and admin apps

This commit is contained in:
yflory
2019-06-27 17:08:12 +02:00
parent 22c9af6961
commit 93b4dac8bb
16 changed files with 507 additions and 161 deletions

View File

@@ -479,7 +479,8 @@ define([
thumbnails: disableThumbnails === false,
isDriveOwned: Boolean(Util.find(store, ['driveMetadata', 'owners'])),
support: Util.find(store.proxy, ['mailboxes', 'support', 'channel']),
pendingFriends: store.proxy.friends_pending || {}
pendingFriends: store.proxy.friends_pending || {},
supportPrivateKey: Util.find(store.proxy, ['mailboxes', 'supportadmin', 'keys', 'curvePrivate'])
}
};
cb(JSON.parse(JSON.stringify(metadata)));
@@ -1060,6 +1061,26 @@ define([
cb(res);
});
};
Store.addAdminMailbox = function (clientId, data, cb) {
var priv = data;
var pub = Hash.getBoxPublicFromSecret(priv);
if (!priv || !pub) { return void cb({error: 'EINVAL'}); }
var channel = Hash.getChannelIdFromKey(pub);
var mailboxes = store.proxy.mailboxes = store.proxy.mailboxes || {};
var box = mailboxes.supportadmin = {
channel: channel,
viewed: [],
lastKnownHash: '',
keys: {
curvePublic: pub,
curvePrivate: priv
}
};
store.mailbox.open('supportadmin', box, function () {
console.log('ready');
});
onSync(cb);
};
//////////////////////////////////////////////////////////////////
/////////////////////// PAD //////////////////////////////////////