mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-07-05 22:29:13 +02:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user