Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions app/models/server/models/Users.js
Original file line number Diff line number Diff line change
Expand Up @@ -1551,6 +1551,17 @@ Find users to send a message by email if:

return this.find(query, options);
}

getLanguages() {
const query = {
language: {
$exists: true,
$ne: '',
},
};

return this.find(query);
Comment thread
rodrigok marked this conversation as resolved.
Outdated
}
}

export default new Users(Meteor.users, true);
8 changes: 8 additions & 0 deletions app/statistics/server/lib/statistics.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ export const statistics = {
statistics.busyUsers = Meteor.users.find({ status: 'busy' }).count();
statistics.totalConnectedUsers = statistics.onlineUsers + statistics.awayUsers;
statistics.offlineUsers = statistics.totalUsers - statistics.onlineUsers - statistics.awayUsers - statistics.busyUsers;
statistics.languages = { en: 0 };
Comment thread
rodrigok marked this conversation as resolved.
Outdated

const languages = Users.getLanguages();
languages.forEach((i) => {
const l = i.language;
statistics.languages[l] ? statistics.languages[l]++ : statistics.languages[l] = 1;
});
statistics.languages.en += statistics.totalUsers - languages.count();

// Room statistics
statistics.totalRooms = Rooms.find().count();
Expand Down