mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-06 15:42:52 +01: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:
@@ -171,10 +171,11 @@ groupsAPI.leave = async function (caller, data) {
|
||||
throw new Error('[[error:no-privileges]]');
|
||||
}
|
||||
|
||||
const username = await user.getUserField(data.uid, 'username');
|
||||
const { displayname } = await user.getUserFields(data.uid, ['username']);
|
||||
|
||||
const notification = await notifications.create({
|
||||
type: 'group-leave',
|
||||
bodyShort: `[[groups:membership.leave.notification_title, ${username}, ${groupName}]]`,
|
||||
bodyShort: `[[groups:membership.leave.notification_title, ${displayname}, ${groupName}]]`,
|
||||
nid: `group:${validator.escape(groupName)}:uid:${data.uid}:group-leave`,
|
||||
path: `/groups/${slugify(groupName)}`,
|
||||
from: data.uid,
|
||||
|
||||
Reference in New Issue
Block a user