typing notifications: Exclude muted typists.

This commit is contained in:
Abhijeet Prasad Bodas
2021-05-05 09:08:24 +05:30
committed by Tim Abbott
parent 47764ded76
commit 04c355c248
2 changed files with 20 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
import _ from "lodash";
import * as muting from "./muting";
import * as util from "./util";
// See docs/subsystems/typing-indicators.md for details on typing indicators.
@@ -48,14 +49,15 @@ export function remove_typist(group, typist) {
export function get_group_typists(group) {
const key = get_key(group);
return typist_dct.get(key) || [];
const user_ids = typist_dct.get(key) || [];
return muting.filter_muted_user_ids(user_ids);
}
export function get_all_typists() {
let typists = [].concat(...Array.from(typist_dct.values()));
typists = util.sorted_ids(typists);
typists = _.sortedUniq(typists);
return typists;
return muting.filter_muted_user_ids(typists);
}
// The next functions aren't pure data, but it is easy