mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 23:13:25 +00:00
presence: Frontend implementation of the last_update_id API.
Note: This involves adding presence info of unknown users to the presence data. With some small tweaks, we can just add the info to the presence data structures, just making sure the buddy list correctly skips those entries and that we redraw the user in the case where the user creation event arrives after the presence polling loop.
This commit is contained in:
committed by
Tim Abbott
parent
3a680763bd
commit
3ded4c2a7d
@@ -454,13 +454,24 @@ export function dispatch_normal_event(event) {
|
||||
|
||||
case "realm_user":
|
||||
switch (event.op) {
|
||||
case "add":
|
||||
case "add": {
|
||||
// There may be presence data we already received from the server
|
||||
// before getting this event. Check if we need to redraw.
|
||||
const should_redraw = activity_ui.check_should_redraw_new_user(
|
||||
event.person.user_id,
|
||||
);
|
||||
|
||||
people.add_active_user(event.person);
|
||||
settings_account.maybe_update_deactivate_account_button();
|
||||
if (event.person.is_bot) {
|
||||
settings_users.redraw_bots_list();
|
||||
}
|
||||
|
||||
if (should_redraw) {
|
||||
activity_ui.redraw_user(event.person.user_id);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "update":
|
||||
user_events.update_person(event.person);
|
||||
settings_account.maybe_update_deactivate_account_button();
|
||||
|
||||
Reference in New Issue
Block a user