Skip to content

Commit 679c692

Browse files
committed
helper: Update and display all streams unread count.
1 parent 5c0d7c1 commit 679c692

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

zulipterminal/helper.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ def _set_count_in_view(
205205
user_buttons_list = controller.view.user_w.users_btn_list
206206
all_msg = controller.view.home_button
207207
all_pm = controller.view.pm_button
208+
all_stream = controller.view.stream_button
208209
all_mentioned = controller.view.mentioned_button
209210
for message in changed_messages:
210211
user_id = message["sender_id"]
@@ -238,6 +239,9 @@ def _set_count_in_view(
238239
for topic_button in topic_buttons_list:
239240
if topic_button.topic_name == msg_topic:
240241
topic_button.update_count(topic_button.count + new_count)
242+
if add_to_counts:
243+
unread_counts["all_stream_msg"] += new_count
244+
all_stream.update_count(unread_counts["all_stream_msg"])
241245
else:
242246
for user_button in user_buttons_list:
243247
if user_button.user_id == user_id:

zulipterminal/ui_tools/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,9 @@ def __init__(self, streams_btn_list: List[Any], view: Any) -> None:
314314
self.view = view
315315
self.streams_btn_list = streams_btn_list
316316
self.stream_v = StreamsView(self.streams_btn_list, view)
317+
count = self.view.model.unread_counts.get("all_stream_msg", 0)
317318
self.view.stream_button = StreamPanelButton(
318-
controller=self.view.controller, count=0
319+
controller=self.view.controller, count=count
319320
)
320321
self.body = urwid.SimpleFocusListWalker(
321322
[

0 commit comments

Comments
 (0)