|
|
@ -37,11 +37,13 @@ define([
|
|
|
|
// load shared folders
|
|
|
|
// load shared folders
|
|
|
|
// ~resetPins for the team?
|
|
|
|
// ~resetPins for the team?
|
|
|
|
// getPinLimit
|
|
|
|
// getPinLimit
|
|
|
|
|
|
|
|
ctx.teams[id] = team;
|
|
|
|
|
|
|
|
cb();
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var openChannel = function (ctx, team, id, cb) {
|
|
|
|
var openChannel = function (ctx, teamData, id, cb) {
|
|
|
|
// XXX team password?
|
|
|
|
// XXX team password?
|
|
|
|
var secret = Hash.getSecrets('team', team.href);
|
|
|
|
var secret = Hash.getSecrets('team', teamData.href);
|
|
|
|
var crypto = Crypto.createEncryptor(secret.keys);
|
|
|
|
var crypto = Crypto.createEncryptor(secret.keys);
|
|
|
|
|
|
|
|
|
|
|
|
var cfg = {
|
|
|
|
var cfg = {
|
|
|
@ -65,7 +67,8 @@ define([
|
|
|
|
// types are DRIVE_CHANGE, DRIVE_REMOVE and DRIVE_LOG
|
|
|
|
// types are DRIVE_CHANGE, DRIVE_REMOVE and DRIVE_LOG
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
ctx.teams[id] = {
|
|
|
|
var team = {
|
|
|
|
|
|
|
|
id: id,
|
|
|
|
proxy: lm.proxy,
|
|
|
|
proxy: lm.proxy,
|
|
|
|
listmap: lm,
|
|
|
|
listmap: lm,
|
|
|
|
clients: [],
|
|
|
|
clients: [],
|
|
|
@ -78,6 +81,7 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
onReady(ctx, team, id, function () {
|
|
|
|
onReady(ctx, team, id, function () {
|
|
|
|
// TODO
|
|
|
|
// TODO
|
|
|
|
|
|
|
|
cb();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
if (ctx.onReadyHandlers.length) {
|
|
|
|
if (ctx.onReadyHandlers.length) {
|
|
|
|
ctx.onReadyHandlers.forEach(function (f) {
|
|
|
|
ctx.onReadyHandlers.forEach(function (f) {
|
|
|
@ -145,6 +149,9 @@ define([
|
|
|
|
team.getTeam = function (id) {
|
|
|
|
team.getTeam = function (id) {
|
|
|
|
return ctx.teams[id];
|
|
|
|
return ctx.teams[id];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
team.getTeams = function () {
|
|
|
|
|
|
|
|
return Object.keys(ctx.teams);
|
|
|
|
|
|
|
|
};
|
|
|
|
team.removeClient = function (clientId) {
|
|
|
|
team.removeClient = function (clientId) {
|
|
|
|
removeClient(ctx, clientId);
|
|
|
|
removeClient(ctx, clientId);
|
|
|
|
};
|
|
|
|
};
|
|
|
|