people: Add common function for getting active human users.

This commit is contained in:
Shubham Dhama
2018-07-28 23:43:20 +05:30
committed by Tim Abbott
parent fd71f7282d
commit 16357fc84a
2 changed files with 13 additions and 0 deletions

View File

@@ -617,6 +617,13 @@ exports.get_realm_persons = function () {
return active_user_dict.values();
};
exports.get_active_human_persons = function () {
var human_persons = exports.get_realm_persons().filter(function (person) {
return !person.is_bot;
});
return human_persons;
};
exports.get_active_user_ids = function () {
// This includes active users and active bots.
return active_user_dict.keys();