/
githubmirror
/
zulip
Обзор
Документация
Войти
/
githubmirror
/
zulip
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
web/src/message_user_ids.ts
26 строк
706 B
Lauryn Menard
web-src: Update comments with "private message" or "PM".
26 июн 2023, 21:07
26 июн 2023, 21:07
4d3d9bc
Код
Авторство
О чём код?
/* We keep a set of user_ids for all people who have sent stream messages or who have been on direct messages 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 [...user_set]; } export function add_user_id(user_id: number): void { user_set.add(user_id); }