From 97f322753a8c385705448b2e391b7d3f29e4588b Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 18 Dec 2019 17:12:29 +0100 Subject: [PATCH] Add owners to invitation channels --- www/common/outer/team.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/www/common/outer/team.js b/www/common/outer/team.js index 588bd9965..09e2cb52d 100644 --- a/www/common/outer/team.js +++ b/www/common/outer/team.js @@ -1279,6 +1279,8 @@ define([ var seeds = data.seeds; // {scrypt, preview} var bytes64 = data.bytes64; + if (!teamId || !team) { return void cb({error: 'EINVAL'}); } + var roster = team.roster; var teamName; @@ -1311,12 +1313,16 @@ define([ var putOpts = { initialState: '{}', network: ctx.store.network, + metadata: { + owners: [ctx.store.proxy.edPublic, ephemeralKeys.edPublic] + } }; (function () { // a random signing keypair to prevent further writes to the channel // we don't need to remember it cause we're only writing once var sign = Invite.generateSignPair(); // { validateKey, signKey} + putOpts.metadata.validateKey = sign.validateKey; // visible with only the invite link var previewContent = { @@ -1324,7 +1330,6 @@ define([ message: message, author: Messaging.createData(ctx.store.proxy, false), displayName: name, - curvePublic: ephemeralKeys.curvePublic, }; var cryptput_config = { @@ -1351,6 +1356,7 @@ define([ // a different random signing key so that the server can't correlate these documents // as components of an invite var sign = Invite.generateSignPair(); // { validateKey, signKey} + putOpts.metadata.validateKey = sign.validateKey; // available only with the link and the content var inviteContent = {