From de34c7d5763b06f8173dad444a476fb431f224d2 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Tue, 29 Dec 2015 13:19:33 -0500 Subject: [PATCH] fixed #3966 --- src/notifications.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/notifications.js b/src/notifications.js index b76863e7e5..2b6e7e4733 100644 --- a/src/notifications.js +++ b/src/notifications.js @@ -382,11 +382,15 @@ var async = require('async'), case 'notifications:user_flagged_post_in': var usernames = set.map(function(notifObj) { return notifObj.user.username; + }).filter(function(username, idx, array) { + return array.indexOf(username) === idx }); var numUsers = usernames.length; // 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 + ']]' } else { notifications[modifyIndex].bodyShort = '[[' + mergeId + '_multiple, ' + usernames[0] + ', ' + (numUsers-1) + ', ' + notifications[modifyIndex].topicTitle + ']]'