Add current user back to the buddy list.

For many years we have been excluding the current user
from the buddy list, since their presence is kind
of implicit, and it saves a line of real estate.

This commit removes various user-is-me checks
and puts the user back for the following reasons:

    * explicit is better
    * newbies will be less confused when they
      can see they're actually online
    * even long-time users like myself will
      feel more comfortable if it's just there
    * having yourself in the buddy list facilitates
      things like checking your presence or sending
      yourself a message
    * showing "me" reinforces the meaning of the
      green circle (if my circle is green and I'm
      active, then others with green circles must
      be active too)
    * If you're literally the first user in the
      realm, you can now see what the buddy list
      looks like and try out the chevron menu.

The biggest tradeoff here is the opportunity cost.
For an org with more people than fit on the screen,
we put the Nth person below the fold to show "me".
I think that's fine--users can still scroll or
search.

This commit doesn't do anything special with the
current user in terms of sorting them higher in the
list or giving specific styling.

Fixes #10476
This commit is contained in:
Steve Howell
2018-09-08 12:41:41 +00:00
committed by Tim Abbott
parent e978158519
commit 3aa490edbe
7 changed files with 45 additions and 28 deletions

View File

@@ -103,10 +103,6 @@ exports.set_info = function (presences, server_timestamp) {
_.each(presences, function (info, this_email) {
var person = people.get_by_email(this_email);
if (people.is_current_user(this_email)) {
return;
}
if (person === undefined) {
if (!(server_events.suspect_offline || reload_state.is_in_progress())) {
// If we're online, and we get a user who we don't
@@ -143,10 +139,7 @@ exports.update_info_for_small_realm = function () {
_.each(persons, function (person) {
var user_id = person.user_id;
if (people.is_my_user_id(user_id)) {
return;
}
var status = "offline";
if (presence_info[user_id]) {
// this is normal, we have data for active
@@ -159,8 +152,12 @@ exports.update_info_for_small_realm = function () {
return;
}
if (people.is_my_user_id(user_id)) {
status = "active";
}
presence_info[user_id] = {
status: "offline",
status: status,
mobile: false,
last_active: undefined,
};