diff --git a/public/language/en-GB/global.json b/public/language/en-GB/global.json index 14d9b13421..9f5ad80e7a 100644 --- a/public/language/en-GB/global.json +++ b/public/language/en-GB/global.json @@ -108,6 +108,7 @@ "guest": "Guest", "guests": "Guests", + "former_user": "A Former User", "updated.title": "Forum Updated", "updated.message": "This forum has just been updated to the latest version. Click here to refresh the page.", diff --git a/src/user/data.js b/src/user/data.js index 05ebc2f9b2..dc851dc8c4 100644 --- a/src/user/data.js +++ b/src/user/data.js @@ -119,6 +119,11 @@ module.exports = function (User) { return memo; }, {}); var users = uids.map(function (uid) { + const returnPayload = usersData[ref[uid]]; + if (uid > 0 && !returnPayload.uid) { + returnPayload.oldUid = parseInt(uid, 10); + } + return usersData[ref[uid]]; }); return users; @@ -144,7 +149,7 @@ module.exports = function (User) { if (!parseInt(user.uid, 10)) { user.uid = 0; - user.username = '[[global:guest]]'; + user.username = (user.hasOwnProperty('oldUid') && parseInt(user.oldUid, 10)) ? '[[global:former_user]]' : '[[global:guest]]'; user.userslug = ''; user.picture = User.getDefaultAvatar(); user['icon:text'] = '?';