Improve sharing between drive and teams

This commit is contained in:
yflory
2019-09-18 16:02:58 +02:00
parent fc2938a27e
commit 0d3f9db184
5 changed files with 75 additions and 37 deletions

View File

@@ -692,6 +692,14 @@ define([
var parsed = Hash.parsePadUrl(data.href);
var secret = Hash.getSecrets(parsed.type, parsed.hash, data.password);
if (!secret || !secret.channel) { return void cb ({error: 'EINVAL'}); }
if (parsed.type === 'drive') {
// Shared folder
var teamId = data.teamId === -1 ? undefined : data.teamId;
common.addSharedFolder(teamId, secret, cb);
return;
}
Nthen(function (waitFor) {
if (parsed.hashData.type !== 'pad') { return; }
// Set the correct owner and expiration time if we can find them