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

@@ -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,