Skip to content

Commit

Permalink
fix: Seat counter including apps (#29489)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo authored and sampaiodiego committed Jun 7, 2023
1 parent 90d310a commit cd86eb2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/sixty-owls-shout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': patch
---

Fix seats counter including apps
16 changes: 13 additions & 3 deletions apps/meteor/server/models/raw/Users.js
Original file line number Diff line number Diff line change
Expand Up @@ -2794,9 +2794,19 @@ export class UsersRaw extends BaseRaw {
// here
getActiveLocalUserCount() {
return Promise.all([
this.col.countDocuments({ active: true }),
this.col.countDocuments({ federated: true }),
this.col.countDocuments({ isRemote: true }),
this.col.countDocuments({
active: true,
type: {
$nin: ['app'],
},
roles: { $ne: ['guest'] },
}),
this.col.countDocuments({ federated: true, active: true }),
this.col.countDocuments({
isRemote: true,
active: true,
roles: { $ne: ['guest'] },
}),
]).then((results) => results.reduce((a, b) => a - b));
}

Expand Down

0 comments on commit cd86eb2

Please sign in to comment.