Skip to content
Snippets Groups Projects
Commit a43564de authored by Rodrigo Nascimento's avatar Rodrigo Nascimento
Browse files

Return user’s _id and username for `groups/channels.online`

parent 0810264b
No related merge requests found
...@@ -394,7 +394,10 @@ RocketChat.API.v1.addRoute('channels.online', { authRequired: true }, { ...@@ -394,7 +394,10 @@ RocketChat.API.v1.addRoute('channels.online', { authRequired: true }, {
const onlineInRoom = []; const onlineInRoom = [];
online.forEach(user => { online.forEach(user => {
if (room.usernames.indexOf(user.username) !== -1) { if (room.usernames.indexOf(user.username) !== -1) {
onlineInRoom.push(user.username); onlineInRoom.push({
_id: user._id,
username: user.username
});
} }
}); });
......
...@@ -302,7 +302,10 @@ RocketChat.API.v1.addRoute('groups.online', { authRequired: true }, { ...@@ -302,7 +302,10 @@ RocketChat.API.v1.addRoute('groups.online', { authRequired: true }, {
const onlineInRoom = []; const onlineInRoom = [];
online.forEach(user => { online.forEach(user => {
if (room.usernames.indexOf(user.username) !== -1) { if (room.usernames.indexOf(user.username) !== -1) {
onlineInRoom.push(user.username); onlineInRoom.push({
_id: user._id,
username: user.username
});
} }
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment