mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-12 17:05:51 +01:00
fixed #3966
This commit is contained in:
@@ -382,11 +382,15 @@ var async = require('async'),
|
|||||||
case 'notifications:user_flagged_post_in':
|
case 'notifications:user_flagged_post_in':
|
||||||
var usernames = set.map(function(notifObj) {
|
var usernames = set.map(function(notifObj) {
|
||||||
return notifObj.user.username;
|
return notifObj.user.username;
|
||||||
|
}).filter(function(username, idx, array) {
|
||||||
|
return array.indexOf(username) === idx
|
||||||
});
|
});
|
||||||
var numUsers = usernames.length;
|
var numUsers = usernames.length;
|
||||||
|
|
||||||
// Update bodyShort
|
// Update bodyShort
|
||||||
if (numUsers === 2) {
|
if (numUsers === 1) {
|
||||||
|
// No need to change anything, actually...
|
||||||
|
} else if (numUsers === 2) {
|
||||||
notifications[modifyIndex].bodyShort = '[[' + mergeId + '_dual, ' + usernames.join(', ') + ', ' + notifications[modifyIndex].topicTitle + ']]'
|
notifications[modifyIndex].bodyShort = '[[' + mergeId + '_dual, ' + usernames.join(', ') + ', ' + notifications[modifyIndex].topicTitle + ']]'
|
||||||
} else {
|
} else {
|
||||||
notifications[modifyIndex].bodyShort = '[[' + mergeId + '_multiple, ' + usernames[0] + ', ' + (numUsers-1) + ', ' + notifications[modifyIndex].topicTitle + ']]'
|
notifications[modifyIndex].bodyShort = '[[' + mergeId + '_multiple, ' + usernames[0] + ', ' + (numUsers-1) + ', ' + notifications[modifyIndex].topicTitle + ']]'
|
||||||
|
|||||||
Reference in New Issue
Block a user