From fb3a9740bd386821a9254f28bd8de07f6b1ef4e7 Mon Sep 17 00:00:00 2001 From: negue Date: Thu, 29 Nov 2018 20:00:05 +0100 Subject: [PATCH] add display name to the email variables --- website/server/controllers/api-v4/members.js | 2 +- website/server/libs/chatReporting/chatReporter.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/website/server/controllers/api-v4/members.js b/website/server/controllers/api-v4/members.js index 333b1686da..c810cba836 100644 --- a/website/server/controllers/api-v4/members.js +++ b/website/server/controllers/api-v4/members.js @@ -19,7 +19,7 @@ let api = {}; * @apiSuccess {Object} data.flags The flags of the message * @apiSuccess {Number} data.flagCount The number of flags the message has * @apiSuccess {UUID} data.uuid The user id of the author of the message, or of the recipient if `sent` is true - * @apiSuccess {String} data.user The username of the author of the message, or of the recipient if `sent` is true + * @apiSuccess {String} data.user The Display Name of the author of the message, or of the recipient if `sent` is true * * @apiUse MessageNotFound * @apiUse MessageIdRequired diff --git a/website/server/libs/chatReporting/chatReporter.js b/website/server/libs/chatReporting/chatReporter.js index 148dbd4696..5ed7971316 100644 --- a/website/server/libs/chatReporting/chatReporter.js +++ b/website/server/libs/chatReporting/chatReporter.js @@ -18,12 +18,14 @@ export default class ChatReporter { {name: 'MESSAGE_TIME', content: (new Date(message.timestamp)).toString()}, {name: 'MESSAGE_TEXT', content: message.text}, - {name: 'REPORTER_USERNAME', content: this.user.profile.name}, + {name: 'REPORTER_DISPLAYNAME', content: this.user.profile.name}, + {name: 'REPORTER_USERNAME', content: this.user.auth.local.username}, {name: 'REPORTER_UUID', content: this.user._id}, {name: 'REPORTER_EMAIL', content: reporterEmailContent}, {name: 'REPORTER_MODAL_URL', content: `/static/front/#?memberId=${this.user._id}`}, - {name: 'AUTHOR_USERNAME', content: message.user}, + {name: 'AUTHOR_DISPLAYNAME', content: message.user}, + {name: 'AUTHOR_USERNAME', content: message.username}, {name: 'AUTHOR_UUID', content: message.uuid}, {name: 'AUTHOR_EMAIL', content: this.authorEmail}, {name: 'AUTHOR_MODAL_URL', content: `/static/front/#?memberId=${message.uuid}`},