Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
typing_data: Rename get_all_typists to get_all_direct_message_typists.
Dineshc453a784e23c
diff --git a/docs/subsystems/typing-indicators.md b/docs/subsystems/typing-indicators.mdindex 390c2e88626..75e29cf4bc9 100644--- a/docs/subsystems/typing-indicators.md+++ b/docs/subsystems/typing-indicators.md@@ -133,7 +133,7 @@ like the following:- `add_typist`- `remove_typist`- `get_group_typists`-- `get_all_typists`+- `get_all_direct_message_typists`One subtle thing that the client has to do here is to maintaintimers for typing notifications. The value ofdiff --git a/web/src/typing_data.ts b/web/src/typing_data.tsindex 3ad98fb5911..d6303064d8d 100644--- a/web/src/typing_data.ts+++ b/web/src/typing_data.ts@@ -45,7 +45,7 @@ export function get_group_typists(group: number[]): number[] {return muted_users.filter_muted_user_ids(user_ids);}-export function get_all_typists(): number[] {+export function get_all_direct_message_typists(): number[] {let typists = [...typist_dct.values()].flat();typists = util.sorted_ids(typists);return muted_users.filter_muted_user_ids(typists);diff --git a/web/src/typing_events.js b/web/src/typing_events.jsindex e613fec409d..3d30d428947 100644--- a/web/src/typing_events.js+++ b/web/src/typing_events.js@@ -47,8 +47,8 @@ function get_users_typing_for_narrow() {const group = [...narrow_user_ids, page_params.user_id];return typing_data.get_group_typists(group);}- // Get all users typing (in all private conversations with current user)- return typing_data.get_all_typists();+ // Get all users typing (in all direct message conversations with current user)+ return typing_data.get_all_direct_message_typists();}export function render_notifications_for_narrow() {diff --git a/web/tests/typing_data.test.js b/web/tests/typing_data.test.jsindex 92766aedccf..707cce84444 100644--- a/web/tests/typing_data.test.js+++ b/web/tests/typing_data.test.js@@ -34,8 +34,8 @@ test("basics", () => {typing_data.add_typist([7, 15], 7);typing_data.add_typist([7, 15], 15);- // test get_all_typists- assert.deepEqual(typing_data.get_all_typists(), [7, 10, 15]);+ // test get_all_direct_message_typists+ assert.deepEqual(typing_data.get_all_direct_message_typists(), [7, 10, 15]);// test basic removalassert.ok(typing_data.remove_typist([15, 7], 7));@@ -44,16 +44,16 @@ test("basics", () => {// test removing an id that is not thereassert.ok(!typing_data.remove_typist([15, 7], 7));assert.deepEqual(typing_data.get_group_typists([7, 15]), [15]);- assert.deepEqual(typing_data.get_all_typists(), [10, 15]);+ assert.deepEqual(typing_data.get_all_direct_message_typists(), [10, 15]);// remove user from one group, but "15" will still be among// "all typists"assert.ok(typing_data.remove_typist([15, 7], 15));- assert.deepEqual(typing_data.get_all_typists(), [10, 15]);+ assert.deepEqual(typing_data.get_all_direct_message_typists(), [10, 15]);// now remove from the other groupassert.ok(typing_data.remove_typist([5, 15, 10], 15));- assert.deepEqual(typing_data.get_all_typists(), [10]);+ assert.deepEqual(typing_data.get_all_direct_message_typists(), [10]);// test duplicate ids in a groupstyping_data.add_typist([20, 40, 20], 20);@@ -66,12 +66,12 @@ test("muted_typists_excluded", () => {// Nobody is muted.assert.deepEqual(typing_data.get_group_typists([5, 10, 15]), [5, 10]);- assert.deepEqual(typing_data.get_all_typists(), [5, 10]);+ assert.deepEqual(typing_data.get_all_direct_message_typists(), [5, 10]);// Mute a user, and test that the get_* functions exclude that user.muted_users.add_muted_user(10);assert.deepEqual(typing_data.get_group_typists([5, 10, 15]), [5]);- assert.deepEqual(typing_data.get_all_typists(), [5]);+ assert.deepEqual(typing_data.get_all_direct_message_typists(), [5]);});test("timers", () => {