Fix mailbox issue and add XXX

pull/1/head
yflory 5 years ago
parent f7b61daff3
commit bcfa09f7bc

@ -1577,6 +1577,8 @@ define([
}); });
}; };
// XXX call mailbox.open when you create or join a team
// XXX close the mailbox hwne you leave the team
var deriveMailbox = function (team) { var deriveMailbox = function (team) {
if (!team) { return; } if (!team) { return; }
if (team.keys && team.keys.mailbox) { return team.keys.mailbox; } if (team.keys && team.keys.mailbox) { return team.keys.mailbox; }
@ -1626,7 +1628,7 @@ define([
Object.keys(teams).forEach(function (id) { Object.keys(teams).forEach(function (id) {
ctx.onReadyHandlers[id] = []; ctx.onReadyHandlers[id] = [];
if (!Util.find(teams, id, 'keys', 'mailbox')) { if (!Util.find(teams, [id, 'keys', 'mailbox'])) {
teams[id].keys.mailbox = deriveMailbox(teams[id]); teams[id].keys.mailbox = deriveMailbox(teams[id]);
} }
openChannel(ctx, teams[id], id, waitFor(function (err) { openChannel(ctx, teams[id], id, waitFor(function (err) {

Loading…
Cancel
Save