@@ -135,7 +135,7 @@ class Index(TypedDict):
135135
136136class UnreadCounts (TypedDict ):
137137 all_msg : int
138- all_pms : int
138+ all_dms : int
139139 all_mentions : int
140140 unread_topics : Dict [Tuple [int , str ], int ] # stream_id, topic
141141 unread_pms : Dict [int , int ] # sender_id
@@ -227,7 +227,7 @@ def _set_count_in_view(
227227) -> None :
228228 """
229229 This function for the most part contains the logic for setting the
230- count in the UI buttons. The later buttons (all_msg, all_pms )
230+ count in the UI buttons. The later buttons (all_msg, all_dms )
231231 additionally set the current count in the model and make use of the
232232 same in the UI.
233233 """
@@ -238,7 +238,7 @@ def _set_count_in_view(
238238 toggled_stream_id = controller .view .topic_w .stream_button .stream_id
239239 user_buttons_list = controller .view .user_w .users_btn_list
240240 all_msg = controller .view .home_button
241- all_pm = controller .view .pm_button
241+ all_dm = controller .view .pm_button
242242 all_mentioned = controller .view .mentioned_button
243243 for message in changed_messages :
244244 user_id = message ["sender_id" ]
@@ -277,8 +277,8 @@ def _set_count_in_view(
277277 if user_button .user_id == user_id :
278278 user_button .update_count (user_button .count + new_count )
279279 break
280- unread_counts ["all_pms " ] += new_count
281- all_pm .update_count (unread_counts ["all_pms " ])
280+ unread_counts ["all_dms " ] += new_count
281+ all_dm .update_count (unread_counts ["all_dms " ])
282282
283283 if add_to_counts :
284284 unread_counts ["all_msg" ] += new_count
@@ -487,7 +487,7 @@ def classify_unread_counts(model: Any) -> UnreadCounts:
487487
488488 unread_counts = UnreadCounts (
489489 all_msg = 0 ,
490- all_pms = 0 ,
490+ all_dms = 0 ,
491491 all_mentions = 0 ,
492492 unread_topics = dict (),
493493 unread_pms = dict (),
@@ -502,7 +502,7 @@ def classify_unread_counts(model: Any) -> UnreadCounts:
502502 count = len (dm ["unread_message_ids" ])
503503 unread_counts ["unread_pms" ][dm ["sender_id" ]] = count
504504 unread_counts ["all_msg" ] += count
505- unread_counts ["all_pms " ] += count
505+ unread_counts ["all_dms " ] += count
506506
507507 for stream in unread_msg_counts ["streams" ]:
508508 count = len (stream ["unread_message_ids" ])
@@ -522,13 +522,13 @@ def classify_unread_counts(model: Any) -> UnreadCounts:
522522 unread_counts ["all_msg" ] += count
523523
524524 # store unread count of group dms in `unread_huddles`
525- for group_pm in unread_msg_counts ["huddles" ]:
526- count = len (group_pm ["unread_message_ids" ])
527- user_ids = group_pm ["user_ids_string" ].split ("," )
525+ for group in unread_msg_counts ["huddles" ]:
526+ count = len (group ["unread_message_ids" ])
527+ user_ids = group ["user_ids_string" ].split ("," )
528528 user_ids = frozenset (map (int , user_ids ))
529529 unread_counts ["unread_huddles" ][user_ids ] = count
530530 unread_counts ["all_msg" ] += count
531- unread_counts ["all_pms " ] += count
531+ unread_counts ["all_dms " ] += count
532532
533533 return unread_counts
534534
0 commit comments