From 506467ad6f3e8261c4f63e04e8f5ad7fce1cef53 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Tue, 24 Jul 2018 10:30:47 -0400 Subject: [PATCH] closes #6663 --- install/package.json | 4 ++-- public/language/en-GB/modules.json | 3 ++- src/messaging/rooms.js | 8 ++++++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/install/package.json b/install/package.json index e09864dc4d..d700ce2647 100644 --- a/install/package.json +++ b/install/package.json @@ -75,9 +75,9 @@ "nodebb-plugin-spam-be-gone": "0.5.4", "nodebb-rewards-essentials": "0.0.11", "nodebb-theme-lavender": "5.0.5", - "nodebb-theme-persona": "9.0.21", + "nodebb-theme-persona": "9.0.22", "nodebb-theme-slick": "1.2.6", - "nodebb-theme-vanilla": "10.0.19", + "nodebb-theme-vanilla": "10.0.20", "nodebb-widget-essentials": "4.0.7", "nodemailer": "^4.6.5", "passport": "^0.4.0", diff --git a/public/language/en-GB/modules.json b/public/language/en-GB/modules.json index 63a464e916..df6ca5568a 100644 --- a/public/language/en-GB/modules.json +++ b/public/language/en-GB/modules.json @@ -22,7 +22,7 @@ "chat.delete_message_confirm": "Are you sure you wish to delete this message?", "chat.retrieving-users": "Retrieving users...", "chat.manage-room": "Manage Chat Room", - "chat.add-user-help": "Search for users here. When selected, the user will be added to the chat. The new user will not be able to see chat messages written before they were added to the conversation. Only room owners may remove users from chat rooms.", + "chat.add-user-help": "Search for users here. When selected, the user will be added to the chat. The new user will not be able to see chat messages written before they were added to the conversation. Only room owners () may remove users from chat rooms.", "chat.confirm-chat-with-dnd-user": "This user has set their status to DnD(Do not disturb). Do you still want to chat with them?", "chat.rename-room": "Rename Room", "chat.rename-placeholder": "Enter your room name here", @@ -33,6 +33,7 @@ "chat.in-room": "In this room", "chat.kick": "Kick", "chat.show-ip": "Show IP", + "chat.owner": "Room Owner", "composer.compose": "Compose", "composer.show_preview": "Show Preview", diff --git a/src/messaging/rooms.js b/src/messaging/rooms.js index 219f19513c..6e85e594d0 100644 --- a/src/messaging/rooms.js +++ b/src/messaging/rooms.js @@ -229,6 +229,14 @@ module.exports = function (Messaging) { function (uids, next) { user.getUsersFields(uids, ['uid', 'username', 'picture', 'status'], next); }, + function (users, next) { + db.getObjectField('chat:room:' + roomId, 'owner', function (err, ownerId) { + next(err, users.map(function (user) { + user.isOwner = parseInt(user.uid, 10) === parseInt(ownerId, 10); + return user; + })); + }); + }, ], callback); };