Files
zulip/web/src/message_user_ids.ts
Anders Kaseorg c1675913a2 web: Move web app to ‘web’ directory.
Ever since we started bundling the app with webpack, there’s been less
and less overlap between our ‘static’ directory (files belonging to
the frontend app) and Django’s interpretation of the ‘static’
directory (files served directly to the web).

Split the app out to its own ‘web’ directory outside of ‘static’, and
remove all the custom collectstatic --ignore rules.  This makes it
much clearer what’s actually being served to the web, and what’s being
bundled by webpack.  It also shrinks the release tarball by 3%.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-02-23 16:04:17 -08:00

27 lines
701 B
TypeScript

/*
We keep a set of user_ids for all people
who have sent stream messages or who have
been on PMs sent by the user.
We will use this in search to prevent really
large result sets for realms that have lots
of users who haven't sent messages recently.
We'll likely eventually want to replace this with
accessing some combination of data from recent_senders
and pm_conversations for better accuracy.
*/
const user_set = new Set<number>();
export function clear_for_testing(): void {
user_set.clear();
}
export function user_ids(): number[] {
return Array.from(user_set);
}
export function add_user_id(user_id: number): void {
user_set.add(user_id);
}