mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +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
@@ -78,6 +78,16 @@ export function redraw_user(user_id: number): void {
|
||||
});
|
||||
}
|
||||
|
||||
export function check_should_redraw_new_user(user_id: number): boolean {
|
||||
if (realm.realm_presence_disabled) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const user_is_in_presence_info = presence.presence_info.has(user_id);
|
||||
const user_not_yet_known = people.maybe_get_user_by_id(user_id, true) === undefined;
|
||||
return user_is_in_presence_info && user_not_yet_known;
|
||||
}
|
||||
|
||||
export function searching(): boolean {
|
||||
return user_filter?.searching() ?? false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user