From 804443e5f720c08eb0a304446b80623abcb5f746 Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 15 Oct 2020 15:12:12 +0530 Subject: [PATCH] send basic team info along with support tickets ...and fix a server bug that had broken /api/config.supportMailbox --- server.js | 2 +- www/support/ui.js | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index 0d048d3a5..0e0c2d79e 100644 --- a/server.js +++ b/server.js @@ -189,7 +189,7 @@ var serveConfig = (function () { adminEmail: Env.adminEmail, adminKeys: Env.admins, inactiveTime: Env.inactiveTime, - supportMailbox: Env.supportMailboxPublicKey, + supportMailbox: Env.supportMailbox, maxUploadSize: Env.maxUploadSize, premiumUploadSize: Env.premiumUploadSize, }, null, '\t'), diff --git a/www/support/ui.js b/www/support/ui.js index 0519530da..1cc1ee90e 100644 --- a/www/support/ui.js +++ b/www/support/ui.js @@ -26,7 +26,6 @@ define([ curvePublic: user.curvePublic, edPublic: privateData.edPublic, notifications: user.notifications, - blockLocation: privateData.blockLocation || '', }; if (typeof(ctx.pinUsage) === 'object') { @@ -39,8 +38,19 @@ define([ data.id = id; data.time = +new Date(); + var teams = privateData.teams || {}; if (!ctx.isAdmin) { data.sender.userAgent = window.navigator && window.navigator.userAgent; + data.sender.blockLocation = privateData.blockLocation || ''; + data.sender.teams = Object.keys(teams).map(function (key) { + var team = teams[key]; + if (!teams) { return; } + var ret = {}; + ['edPublic', 'owner', 'viewer', 'hasSecondaryKey'].forEach(function (k) { + ret[k] = team[k]; + }); + return ret; + }).filter(Boolean); } // Send the message to the admin mailbox and to the user mailbox