send basic team info along with support tickets

...and fix a server bug that had broken /api/config.supportMailbox
pull/1/head
ansuz 4 years ago
parent 713c8c574b
commit 804443e5f7

@ -189,7 +189,7 @@ var serveConfig = (function () {
adminEmail: Env.adminEmail, adminEmail: Env.adminEmail,
adminKeys: Env.admins, adminKeys: Env.admins,
inactiveTime: Env.inactiveTime, inactiveTime: Env.inactiveTime,
supportMailbox: Env.supportMailboxPublicKey, supportMailbox: Env.supportMailbox,
maxUploadSize: Env.maxUploadSize, maxUploadSize: Env.maxUploadSize,
premiumUploadSize: Env.premiumUploadSize, premiumUploadSize: Env.premiumUploadSize,
}, null, '\t'), }, null, '\t'),

@ -26,7 +26,6 @@ define([
curvePublic: user.curvePublic, curvePublic: user.curvePublic,
edPublic: privateData.edPublic, edPublic: privateData.edPublic,
notifications: user.notifications, notifications: user.notifications,
blockLocation: privateData.blockLocation || '',
}; };
if (typeof(ctx.pinUsage) === 'object') { if (typeof(ctx.pinUsage) === 'object') {
@ -39,8 +38,19 @@ define([
data.id = id; data.id = id;
data.time = +new Date(); data.time = +new Date();
var teams = privateData.teams || {};
if (!ctx.isAdmin) { if (!ctx.isAdmin) {
data.sender.userAgent = window.navigator && window.navigator.userAgent; 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 // Send the message to the admin mailbox and to the user mailbox

Loading…
Cancel
Save