Create and store pads in a team

This commit is contained in:
yflory
2019-09-12 17:54:50 +02:00
parent 79ac44de7e
commit 306fc6cdb9
10 changed files with 139 additions and 13 deletions

View File

@@ -523,6 +523,7 @@ define([
// Get the metadata for sframe-common-outer
Store.getMetadata = function (clientId, data, cb) {
var disableThumbnails = Util.find(store.proxy, ['settings', 'general', 'disableThumbnails']);
var teams = store.modules['team'] && store.modules['team'].getTeamsData();
var metadata = {
// "user" is shared with everybody via the userlist
user: {
@@ -544,7 +545,8 @@ define([
isDriveOwned: Boolean(Util.find(store, ['driveMetadata', 'owners'])),
support: Util.find(store.proxy, ['mailboxes', 'support', 'channel']),
pendingFriends: store.proxy.friends_pending || {},
supportPrivateKey: Util.find(store.proxy, ['mailboxes', 'supportadmin', 'keys', 'curvePrivate'])
supportPrivateKey: Util.find(store.proxy, ['mailboxes', 'supportadmin', 'keys', 'curvePrivate']),
teams: teams
}
};
cb(JSON.parse(JSON.stringify(metadata)));

View File

@@ -431,6 +431,16 @@ define([
team.getTeam = function (id) {
return ctx.teams[id];
};
team.getTeamsData = function () {
var t = {};
Object.keys(teams).forEach(function (id) {
t[id] = {
name: teams[id].name,
edPublic: Util.find(teams[id], ['keys', 'edPublic'])
};
});
return t;
};
team.getTeams = function () {
return Object.keys(ctx.teams);
};