Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
rename: Rename "huddle_data.ts" to "direct_message_group_data.ts".
roanster0079f2eb329ef31
diff --git a/web/src/huddle_data.ts b/web/src/direct_message_group_data.tssimilarity index 100%rename from web/src/huddle_data.tsrename to web/src/direct_message_group_data.tsdiff --git a/web/src/message_events.js b/web/src/message_events.jsindex e7d5936530c..3cf128ecc6d 100644--- a/web/src/message_events.js+++ b/web/src/message_events.js@@ -9,8 +9,8 @@ import * as compose_fade from "./compose_fade";import * as compose_notifications from "./compose_notifications";import * as compose_state from "./compose_state";import * as compose_validate from "./compose_validate";+import * as direct_message_group_data from "./direct_message_group_data";import * as drafts from "./drafts";-import * as huddle_data from "./huddle_data";import * as message_edit from "./message_edit";import * as message_edit_history from "./message_edit_history";import * as message_helper from "./message_helper";@@ -114,7 +114,7 @@ export function insert_new_messages(messages, sent_by_this_client) {messages = messages.map((message) => message_helper.process_new_message(message));const any_untracked_unread_messages = unread.process_loaded_messages(messages, false);- huddle_data.process_loaded_messages(messages);+ direct_message_group_data.process_loaded_messages(messages);// all_messages_data is the data that we use to populate// other lists, so we always update thisdiff --git a/web/src/message_fetch.js b/web/src/message_fetch.jsindex 37b985cc526..c0c091e0420 100644--- a/web/src/message_fetch.js+++ b/web/src/message_fetch.js@@ -3,7 +3,7 @@ import $ from "jquery";import {all_messages_data} from "./all_messages_data";import * as blueslip from "./blueslip";import * as channel from "./channel";-import * as huddle_data from "./huddle_data";+import * as direct_message_group_data from "./direct_message_group_data";import * as message_feed_loading from "./message_feed_loading";import * as message_feed_top_notices from "./message_feed_top_notices";import * as message_helper from "./message_helper";@@ -76,7 +76,7 @@ function process_result(data, opts) {}}- huddle_data.process_loaded_messages(messages);+ direct_message_group_data.process_loaded_messages(messages);stream_list.update_streams_sidebar();stream_list.maybe_scroll_narrow_into_view();diff --git a/web/src/search_suggestion.ts b/web/src/search_suggestion.tsindex 8eecf214be0..3c1651ca0c5 100644--- a/web/src/search_suggestion.ts+++ b/web/src/search_suggestion.ts@@ -2,8 +2,8 @@ import Handlebars from "handlebars/runtime";import assert from "minimalistic-assert";import * as common from "./common";+import * as direct_message_group_data from "./direct_message_group_data";import {Filter} from "./filter";-import * as huddle_data from "./huddle_data";import * as narrow_state from "./narrow_state";import {page_params} from "./page_params";import * as people from "./people";@@ -98,7 +98,7 @@ function compare_by_huddle(huddle_emails: string[]): (person1: User, person2: Usreturn user?.user_id ?? [];});// Construct dict for all huddles, so we can look up each's recency- const huddles = huddle_data.get_huddles();+ const huddles = direct_message_group_data.get_huddles();const huddle_dict = new Map<string, number>();for (const [i, huddle] of huddles.entries()) {huddle_dict.set(huddle, i + 1);diff --git a/web/tests/activity.test.js b/web/tests/activity.test.jsindex 04dddf1c1f6..daf5d7f5118 100644--- a/web/tests/activity.test.js+++ b/web/tests/activity.test.js@@ -37,7 +37,7 @@ const watchdog = mock_esm("../src/watchdog");set_global("document", _document);-const huddle_data = zrequire("huddle_data");+const direct_message_group_data = zrequire("direct_message_group_data");const keydown_util = zrequire("keydown_util");const muted_users = zrequire("muted_users");const presence = zrequire("presence");@@ -188,8 +188,8 @@ test("sort_users", () => {assert.deepEqual(user_ids, [fred.user_id, jill.user_id, alice.user_id]);});-test("huddle_data.process_loaded_messages", () => {- // TODO: move this to a module for just testing `huddle_data`+test("direct_message_group_data.process_loaded_messages", () => {+ // TODO: move this to a module for just testing `direct_message_group_data`const huddle1 = "[email protected],[email protected]";const timestamp1 = 1382479029; // older@@ -225,11 +225,11 @@ test("huddle_data.process_loaded_messages", () => {},];- huddle_data.process_loaded_messages(messages);+ direct_message_group_data.process_loaded_messages(messages);const user_ids_string1 = people.emails_strings_to_user_ids_string(huddle1);const user_ids_string2 = people.emails_strings_to_user_ids_string(huddle2);- assert.deepEqual(huddle_data.get_huddles(), [user_ids_string2, user_ids_string1]);+ assert.deepEqual(direct_message_group_data.get_huddles(), [user_ids_string2, user_ids_string1]);});test("presence_list_full_update", ({override, mock_template}) => {diff --git a/web/tests/example5.test.js b/web/tests/example5.test.jsindex 5abc1d80426..dcce6367339 100644--- a/web/tests/example5.test.js+++ b/web/tests/example5.test.js@@ -20,7 +20,7 @@ const {run_test, noop} = require("./lib/test");// First we tell the compiler to skip certain modules and just// replace them with {}.-const huddle_data = mock_esm("../src/huddle_data");+const direct_message_group_data = mock_esm("../src/direct_message_group_data");const message_lists = mock_esm("../src/message_lists");const message_notifications = mock_esm("../src/message_notifications");const message_util = mock_esm("../src/message_util");@@ -96,7 +96,7 @@ run_test("insert_message", ({override}) => {assert.equal(message_store.get(new_message.id), undefined);- helper.redirect(huddle_data, "process_loaded_messages");+ helper.redirect(direct_message_group_data, "process_loaded_messages");helper.redirect(message_notifications, "received_messages");helper.redirect(message_util, "add_new_messages_data");helper.redirect(message_util, "add_new_messages");@@ -111,7 +111,7 @@ run_test("insert_message", ({override}) => {// the code invokes various objects when a new message// comes in:assert.deepEqual(helper.events, [- [huddle_data, "process_loaded_messages"],+ [direct_message_group_data, "process_loaded_messages"],[message_util, "add_new_messages_data"],[message_util, "add_new_messages"],[unread_ui, "update_unread_counts"],diff --git a/web/tests/search_suggestion.test.js b/web/tests/search_suggestion.test.jsindex bfba2d65370..0f8264ca8f9 100644--- a/web/tests/search_suggestion.test.js+++ b/web/tests/search_suggestion.test.js@@ -9,7 +9,7 @@ const {current_user, page_params, realm} = require("./lib/zpage_params");const narrow_state = mock_esm("../src/narrow_state");const stream_topic_history_util = mock_esm("../src/stream_topic_history_util");-const huddle_data = zrequire("huddle_data");+const direct_message_group_data = zrequire("direct_message_group_data");const stream_data = zrequire("stream_data");const stream_topic_history = zrequire("stream_topic_history");@@ -64,7 +64,7 @@ function init() {people.initialize_current_user(me.user_id);stream_topic_history.reset();- huddle_data.clear_for_testing();+ direct_message_group_data.clear_for_testing();stream_data.clear_subscriptions();}@@ -368,7 +368,7 @@ test("group_suggestions", ({mock_template}) => {};}- huddle_data.process_loaded_messages([+ direct_message_group_data.process_loaded_messages([message([bob.user_id, ted.user_id], 99),message([bob.user_id, ted.user_id, jeff.user_id], 98),]);