Fullname in notifications (#10157)

* init - fullname notifications setting

* fullname in topic reply

* fullname for group-request-membership

* fullname for group-leave notification

* fullname for new-post-flag & new-user-flag

* removed log

* fullname for user follow

* fullname in message notification

* fullname in follow

* fullname for sendNotificationToPostOwner

* fullname in sendNotificationToTopicOwner

* fullname in doExport

* shorthand name set

* shorter name set

* fullname in notifications

* displayname for notifications

* removed unused require
This commit is contained in:
Magnus
2022-01-19 16:19:11 +01:00
committed by GitHub
parent 857ac48021
commit 7bd3e31dec
9 changed files with 36 additions and 19 deletions

View File

@@ -736,6 +736,9 @@ Flags.notify = async function (flagObj, uid) {
]);
let uids = admins.concat(globalMods);
let notifObj = null;
const { displayname } = flagObj.reports[flagObj.reports.length - 1].reporter;
if (flagObj.type === 'post') {
const [title, cid] = await Promise.all([
topics.getTitleByPid(flagObj.targetId),
@@ -747,7 +750,7 @@ Flags.notify = async function (flagObj, uid) {
notifObj = await notifications.create({
type: 'new-post-flag',
bodyShort: `[[notifications:user_flagged_post_in, ${flagObj.reports[flagObj.reports.length - 1].reporter.username}, ${titleEscaped}]]`,
bodyShort: `[[notifications:user_flagged_post_in, ${displayname}, ${titleEscaped}]]`,
bodyLong: await plugins.hooks.fire('filter:parse.raw', String(flagObj.description || '')),
pid: flagObj.targetId,
path: `/flags/${flagObj.flagId}`,
@@ -760,7 +763,7 @@ Flags.notify = async function (flagObj, uid) {
} else if (flagObj.type === 'user') {
notifObj = await notifications.create({
type: 'new-user-flag',
bodyShort: `[[notifications:user_flagged_user, ${flagObj.reports[flagObj.reports.length - 1].reporter.username}, ${flagObj.target.username}]]`,
bodyShort: `[[notifications:user_flagged_user, ${displayname}, ${flagObj.target.user.displayname}]]`,
bodyLong: await plugins.hooks.fire('filter:parse.raw', String(flagObj.description || '')),
path: `/flags/${flagObj.flagId}`,
nid: `flag:user:${flagObj.targetId}`,