[FIX] Method `getUsersOfRoom` not returning offline users if limit is not defined (#14753)

pull/14967/head^2
Marcos Spessatto Defendi 7 years ago committed by Diego Sampaio
parent 0e023ee1d7
commit ea1c99f2e3
  1. 7
      server/methods/getUsersOfRoom.js

@ -60,13 +60,12 @@ Meteor.methods({
const total = Subscriptions.findByRoomIdWhenUsernameExists(rid).count();
const users = await findUsers({ rid, status: { $ne: 'offline' }, limit, skip });
if (showAll && users.length < limit) {
if (showAll && (!limit || users.length < limit)) {
const offlineUsers = await findUsers({
rid,
status: { $eq: 'offline' },
limit: limit - users.length,
skip,
limit: limit ? limit - users.length : 0,
skip: skip || 0,
});
return {

Loading…
Cancel
Save