diff --git a/public/language/en-GB/user.json b/public/language/en-GB/user.json index 466f6c27e4..d1bf34e94a 100644 --- a/public/language/en-GB/user.json +++ b/public/language/en-GB/user.json @@ -1,6 +1,7 @@ { "banned": "Banned", "offline": "Offline", + "deleted": "Deleted", "username": "User Name", "joindate": "Join Date", "postcount": "Post Count", diff --git a/src/messaging/data.js b/src/messaging/data.js index 88b6683a11..e18d71113f 100644 --- a/src/messaging/data.js +++ b/src/messaging/data.js @@ -51,11 +51,14 @@ module.exports = function (Messaging) { return msg && msg.fromuid; }); - user.getUsersFields(uids, ['uid', 'username', 'userslug', 'picture', 'status'], next); + user.getUsersFields(uids, ['uid', 'username', 'userslug', 'picture', 'status', 'banned'], next); }, function (users, next) { messages.forEach(function (message, index) { message.fromUser = users[index]; + message.fromUser.banned = !!parseInt(message.fromUser.banned, 10); + message.fromUser.deleted = parseInt(message.fromuid, 10) !== message.fromUser.uid && message.fromUser.uid === 0; + var self = parseInt(message.fromuid, 10) === parseInt(uid, 10); message.self = self ? 1 : 0; message.timestampISO = utils.toISOString(message.timestamp);