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

@@ -11,12 +11,13 @@ const notifications = require('../notifications');
module.exports = function (Groups) {
Groups.requestMembership = async function (groupName, uid) {
await inviteOrRequestMembership(groupName, uid, 'request');
const username = await user.getUserField(uid, 'username');
const { displayname } = await user.getUserFields(uid, ['username']);
const [notification, owners] = await Promise.all([
notifications.create({
type: 'group-request-membership',
bodyShort: `[[groups:request.notification_title, ${username}]]`,
bodyLong: `[[groups:request.notification_text, ${username}, ${groupName}]]`,
bodyShort: `[[groups:request.notification_title, ${displayname}]]`,
bodyLong: `[[groups:request.notification_text, ${displayname}, ${groupName}]]`,
nid: `group:${groupName}:uid:${uid}:request`,
path: `/groups/${slugify(groupName)}`,
from: uid,