diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index b766370c3..af44b3d26 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -184,6 +184,21 @@ define([ list = list.concat(mList); } + if (store.proxy.teams) { + Object.keys(store.proxy.teams).forEach(function (id) { + var team = store.proxy.teams[id]; + if (!team.owner) { return; } + list.push(team.channel); + var chatChannel = Util.find(team, ['keys', 'chat', 'channel']); + var membersChannel = Util.find(team, ['keys', 'members', 'channel']); + var mailboxChannel = Util.find(team, ['keys', 'mailbox', 'channel']); + if (chatChannel) { list.push(chatChannel); } + if (membersChannel) { list.push(membersChannel); } + if (mailboxChannel) { list.push(mailboxChannel); } + // XXX team mailbox + }); + } + list.push(userChannel); list.sort(); diff --git a/www/common/outer/team.js b/www/common/outer/team.js index a717a932f..993611ee3 100644 --- a/www/common/outer/team.js +++ b/www/common/outer/team.js @@ -352,6 +352,8 @@ define([ } }; ctx.store.proxy.teams[id] = { + owner: true, + channel: secret.channel, hash: hash, password: password, keys: keys,