popovers: Don't show bots as deactivated in user popovers.

Apparently this is a bug that slipped in when we started showing
normal users as deactivated in the user popovers: all bot users were
treated that way as well.

We'll want to do #7153 as a follow-up to get things fully working how
we want them.
This commit is contained in:
Tim Abbott
2017-10-24 15:59:51 -07:00
parent 6ed2a9b9f2
commit 11eba1173c
3 changed files with 25 additions and 6 deletions

View File

@@ -530,8 +530,19 @@ exports.realm_get = function realm_get(email) {
return realm_people_dict.get(person.user_id);
};
exports.realm_user_is_active_human = function (id) {
return !!realm_people_dict.get(id);
exports.realm_user_is_active_human_or_bot = function (id) {
if (realm_people_dict.get(id) !== undefined) {
return true;
}
// TODO: Technically, we should probably treat deactivated bots
// like deactivated users here. But we don't have the data to do
// that. See #7153 for notes on fixing this.
var person = exports.get_person_from_user_id(id);
if (person === undefined) {
blueslip.error("Unexpectedly invalid user ID in user popover query " + id);
return false;
}
return !!person.is_bot;
};
exports.get_all_persons = function () {