Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

narrow: Rename `by_topic` to `narrow_by_topic`.

Aman Agrawal48cdfd25f766
diff --git a/web/src/click_handlers.js b/web/src/click_handlers.js
index 1f8ab7e9122..569ed8fbe0a 100644
--- a/web/src/click_handlers.js
+++ b/web/src/click_handlers.js
@@ -483,7 +483,7 @@ export function initialize() {
}
e.preventDefault();
const row_id = get_row_id_for_narrowing(this);
- narrow.by_topic(row_id, {trigger: "message header"});
+ narrow.narrow_by_topic(row_id, {trigger: "message header"});
});
// SIDEBARS
diff --git a/web/src/desktop_integration.js b/web/src/desktop_integration.js
index fcc881c1dc2..e7d735cfe09 100644
--- a/web/src/desktop_integration.js
+++ b/web/src/desktop_integration.js
@@ -27,7 +27,7 @@ export function initialize() {
// The code below is for sending a message received from notification reply which
// is often referred to as inline reply feature. This is done so desktop app doesn't
- // have to depend on channel.post for setting crsf_token and narrow.by_topic
+ // have to depend on channel.post for setting crsf_token and narrow.narrow_by_topic
// to narrow to the message being sent.
if (window.electron_bridge.set_send_notification_reply_message_supported !== undefined) {
window.electron_bridge.set_send_notification_reply_message_supported(true);
@@ -47,7 +47,7 @@ export function initialize() {
function success() {
if (message.type === "stream") {
- narrow.by_topic(message_id, {trigger: "desktop_notification_reply"});
+ narrow.narrow_by_topic(message_id, {trigger: "desktop_notification_reply"});
} else {
narrow.narrow_by_recipient(message_id, {trigger: "desktop_notification_reply"});
}
diff --git a/web/src/hotkey.js b/web/src/hotkey.js
index a546a3a1ea8..fe6a7a52e97 100644
--- a/web/src/hotkey.js
+++ b/web/src/hotkey.js
@@ -1097,7 +1097,7 @@ export function process_hotkey(e, hotkey) {
return false;
}
// else narrow to conversation view (topic / DM)
- return do_narrow_action(narrow.by_topic);
+ return do_narrow_action(narrow.narrow_by_topic);
case "toggle_stream_subscription":
deprecated_feature_notice.maybe_show_deprecation_notice("Shift + S");
return true;
diff --git a/web/src/message_events.js b/web/src/message_events.js
index 439327e59e5..7c2d7388b3d 100644
--- a/web/src/message_events.js
+++ b/web/src/message_events.js
@@ -152,7 +152,7 @@ export function insert_new_messages(messages, sent_by_this_client) {
if (sent_by_this_client) {
compose_notifications.notify_local_mixes(messages, need_user_to_scroll, {
narrow_to_recipient(message_id) {
- narrow.by_topic(message_id, {trigger: "outside_current_view"});
+ narrow.narrow_by_topic(message_id, {trigger: "outside_current_view"});
},
});
}
diff --git a/web/src/message_notifications.js b/web/src/message_notifications.js
index 2044a0919cd..cc83e1fc849 100644
--- a/web/src/message_notifications.js
+++ b/web/src/message_notifications.js
@@ -162,7 +162,7 @@ export function process_notification(notification) {
notification_object.addEventListener("click", () => {
notification_object.close();
if (message.type !== "test-notification") {
- narrow.by_topic(message.id, {trigger: "notification"});
+ narrow.narrow_by_topic(message.id, {trigger: "notification"});
}
window.focus();
});
diff --git a/web/src/narrow.js b/web/src/narrow.js
index e6fed8e71a8..ed6530f76da 100644
--- a/web/src/narrow.js
+++ b/web/src/narrow.js
@@ -997,7 +997,7 @@ export function narrow_to_next_pm_string(opts = {}) {
show(filter_expr, updated_opts);
}
-export function by_topic(target_id, opts) {
+export function narrow_by_topic(target_id, opts) {
// don't use message_lists.current as it won't work for muted messages or for out-of-narrow links
const original = message_store.get(target_id);
if (original.type !== "stream") {
diff --git a/web/src/ui_init.js b/web/src/ui_init.js
index aeb3d0be837..64d49715430 100644
--- a/web/src/ui_init.js
+++ b/web/src/ui_init.js
@@ -839,7 +839,7 @@ export function initialize_everything(state_data) {
compose_notifications.initialize({
on_click_scroll_to_selected: message_viewport.scroll_to_selected,
on_narrow_to_recipient(message_id) {
- narrow.by_topic(message_id, {trigger: "compose_notification"});
+ narrow.narrow_by_topic(message_id, {trigger: "compose_notification"});
},
});
unread_ops.initialize();
diff --git a/web/tests/hotkey.test.js b/web/tests/hotkey.test.js
index 2d535abca5f..17402cae0b9 100644
--- a/web/tests/hotkey.test.js
+++ b/web/tests/hotkey.test.js
@@ -389,7 +389,7 @@ run_test("misc", ({override}) => {
override(narrow_state, "narrowed_by_topic_reply", () => false);
override(narrow_state, "narrowed_by_pm_reply", () => false);
- assert_mapping("s", narrow, "by_topic");
+ assert_mapping("s", message_view, "narrow_by_topic");
override(message_edit, "can_move_message", () => true);
assert_mapping("m", stream_popover, "build_move_topic_to_stream_popover");