|
|
@ -1474,6 +1474,7 @@ define([
|
|
|
|
var acceptLinkInvitation = function (ctx, data, cId, cb) {
|
|
|
|
var acceptLinkInvitation = function (ctx, data, cId, cb) {
|
|
|
|
var inviteContent;
|
|
|
|
var inviteContent;
|
|
|
|
nThen(function (waitFor) {
|
|
|
|
nThen(function (waitFor) {
|
|
|
|
|
|
|
|
// Get team keys and ephemeral keys
|
|
|
|
getInviteContent(ctx, data, cId, waitFor(function (obj) {
|
|
|
|
getInviteContent(ctx, data, cId, waitFor(function (obj) {
|
|
|
|
if (obj && obj.error) {
|
|
|
|
if (obj && obj.error) {
|
|
|
|
waitFor.abort();
|
|
|
|
waitFor.abort();
|
|
|
@ -1482,6 +1483,7 @@ define([
|
|
|
|
inviteContent = obj;
|
|
|
|
inviteContent = obj;
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
}).nThen(function (waitFor) {
|
|
|
|
}).nThen(function (waitFor) {
|
|
|
|
|
|
|
|
// Accept the roster invitation: relplace our ephemeral keys with our user keys
|
|
|
|
var rosterData = Util.find(inviteContent, ['teamData', 'keys', 'roster']);
|
|
|
|
var rosterData = Util.find(inviteContent, ['teamData', 'keys', 'roster']);
|
|
|
|
var myKeys = inviteContent.ephemeral;
|
|
|
|
var myKeys = inviteContent.ephemeral;
|
|
|
|
var rosterKeys = Crypto.Team.deriveMemberKeys(rosterData.edit, myKeys);
|
|
|
|
var rosterKeys = Crypto.Team.deriveMemberKeys(rosterData.edit, myKeys);
|
|
|
@ -1508,7 +1510,10 @@ define([
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
}).nThen(function () {
|
|
|
|
}).nThen(function () {
|
|
|
|
joinTeam(ctx, inviteContent.teamData, cId, cb);
|
|
|
|
// Add the team to our list and join...
|
|
|
|
|
|
|
|
joinTeam(ctx, {
|
|
|
|
|
|
|
|
team: inviteContent.teamData
|
|
|
|
|
|
|
|
}, cId, cb);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|