filter: Use "channel" operator for the Filter class.

Update the Filter class to use "channel" as the canoncial operator
for streams, but keep using "stream" for user-facing text and URLs.

When searching, "channel" does not create any suggestions until
a colon is added and then it shows suggestions with "stream". And
when a search string with channel as an operator is entered, then
it is replaced by "stream" as well.

Part of stream to channel rename project.
This commit is contained in:
Lauryn Menard
2024-04-05 19:41:15 +02:00
committed by Tim Abbott
parent e3a521f4ba
commit 1e7c5b38f8
14 changed files with 208 additions and 127 deletions

View File

@@ -164,9 +164,9 @@ export function initialize(): void {
if (narrow_filter === undefined) {
display_current_view = $t({defaultMessage: "Currently viewing all messages."});
} else if (
_.isEqual(narrow_filter.sorted_term_types(), ["stream"]) &&
_.isEqual(narrow_filter.sorted_term_types(), ["channel"]) &&
compose_state.get_message_type() === "stream" &&
narrow_filter.operands("stream")[0] === compose_state.stream_name()
narrow_filter.operands("channel")[0] === compose_state.stream_name()
) {
display_current_view = $t({
defaultMessage: "Currently viewing the entire stream.",