Skip to content

Commit e1faa9f

Browse files
author
Subhasish-Behera
committed
model: Add alert_words to initial_data_to_fetch.Tests adapted.
1 parent 6cd0fc8 commit e1faa9f

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

tests/model/test_model.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ def test_register_initial_desired_events(self, mocker, initial_data):
254254
"user_settings",
255255
"realm_emoji",
256256
"zulip_version",
257+
"alert_words",
257258
]
258259
model.client.register.assert_called_once_with(
259260
event_types=event_types,

zulipterminal/model.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ def __init__(self, controller: Any) -> None:
138138
# zulip_version and zulip_feature_level are always returned in
139139
# POST /register from Feature level 3.
140140
"zulip_version",
141+
"alert_words",
141142
]
142143

143144
# Events desired with their corresponding callback
@@ -182,6 +183,8 @@ def __init__(self, controller: Any) -> None:
182183

183184
self._subscribe_to_streams(self.initial_data["subscriptions"])
184185

186+
self._alert_words = self.initial_data.get("alert_words", None)
187+
185188
# NOTE: The date_created field of stream has been added in feature
186189
# level 30, server version 4. For consistency we add this field
187190
# on server iterations even before this with value of None.
@@ -339,6 +342,9 @@ def set_search_narrow(self, search_query: str) -> None:
339342
self.unset_search_narrow()
340343
self.narrow.append(["search", search_query])
341344

345+
def get_alert_words(self) -> List[str]:
346+
return self._alert_words
347+
342348
def unset_search_narrow(self) -> None:
343349
# If current narrow is a result of a previous started search,
344350
# we pop the ['search', 'text'] term in the narrow, before

0 commit comments

Comments
 (0)