mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
narrow_term: Refactor a NeverNegatedNarrowTerm.
Previously `NarrowTerm` is only used in our event-handling paths and to a lesser extent in the `detect_narrowed_window` in `view/home.py`. Both of which haven't yet support or handle the `negated` term. Since we're planning to parse a narrow URL into narrow terms (like in `hash_util.ts`) in the web app, we're going to need a `NarrowTerm` dataclass with all three flags. This commit adds the `negated` term to `NarrowTerm` and adds a `NeverNegatedNarrowTerm` which is a subclass of `NarrowTerm` that always has the `negated` flag as `False`, so functionally it is the same as the current `NarrowTerm`.
This commit is contained in:
@@ -14,7 +14,7 @@ from zerver.lib.i18n import (
|
||||
get_language_list,
|
||||
get_language_translation_data,
|
||||
)
|
||||
from zerver.lib.narrow_helpers import NarrowTerm
|
||||
from zerver.lib.narrow_helpers import NeverNegatedNarrowTerm
|
||||
from zerver.lib.realm_description import get_realm_rendered_description
|
||||
from zerver.lib.request import RequestNotes
|
||||
from zerver.models import Message, Realm, Stream, UserProfile
|
||||
@@ -121,7 +121,7 @@ def build_page_params_for_home_page_load(
|
||||
user_profile: UserProfile | None,
|
||||
realm: Realm,
|
||||
insecure_desktop_app: bool,
|
||||
narrow: list[NarrowTerm],
|
||||
narrow: list[NeverNegatedNarrowTerm],
|
||||
narrow_stream: Stream | None,
|
||||
narrow_topic_name: str | None,
|
||||
) -> tuple[int, dict[str, object]]:
|
||||
|
||||
Reference in New Issue
Block a user