@@ -135,7 +135,7 @@ class Index(TypedDict):
135
135
136
136
class UnreadCounts (TypedDict ):
137
137
all_msg : int
138
- all_pms : int
138
+ all_dms : int
139
139
all_mentions : int
140
140
unread_topics : Dict [Tuple [int , str ], int ] # stream_id, topic
141
141
unread_pms : Dict [int , int ] # sender_id
@@ -227,7 +227,7 @@ def _set_count_in_view(
227
227
) -> None :
228
228
"""
229
229
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 )
231
231
additionally set the current count in the model and make use of the
232
232
same in the UI.
233
233
"""
@@ -238,7 +238,7 @@ def _set_count_in_view(
238
238
toggled_stream_id = controller .view .topic_w .stream_button .stream_id
239
239
user_buttons_list = controller .view .user_w .users_btn_list
240
240
all_msg = controller .view .home_button
241
- all_pm = controller .view .pm_button
241
+ all_dm = controller .view .pm_button
242
242
all_mentioned = controller .view .mentioned_button
243
243
for message in changed_messages :
244
244
user_id = message ["sender_id" ]
@@ -277,8 +277,8 @@ def _set_count_in_view(
277
277
if user_button .user_id == user_id :
278
278
user_button .update_count (user_button .count + new_count )
279
279
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 " ])
282
282
283
283
if add_to_counts :
284
284
unread_counts ["all_msg" ] += new_count
@@ -487,7 +487,7 @@ def classify_unread_counts(model: Any) -> UnreadCounts:
487
487
488
488
unread_counts = UnreadCounts (
489
489
all_msg = 0 ,
490
- all_pms = 0 ,
490
+ all_dms = 0 ,
491
491
all_mentions = 0 ,
492
492
unread_topics = dict (),
493
493
unread_pms = dict (),
@@ -502,7 +502,7 @@ def classify_unread_counts(model: Any) -> UnreadCounts:
502
502
count = len (dm ["unread_message_ids" ])
503
503
unread_counts ["unread_pms" ][dm ["sender_id" ]] = count
504
504
unread_counts ["all_msg" ] += count
505
- unread_counts ["all_pms " ] += count
505
+ unread_counts ["all_dms " ] += count
506
506
507
507
for stream in unread_msg_counts ["streams" ]:
508
508
count = len (stream ["unread_message_ids" ])
@@ -522,13 +522,13 @@ def classify_unread_counts(model: Any) -> UnreadCounts:
522
522
unread_counts ["all_msg" ] += count
523
523
524
524
# 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 ("," )
528
528
user_ids = frozenset (map (int , user_ids ))
529
529
unread_counts ["unread_huddles" ][user_ids ] = count
530
530
unread_counts ["all_msg" ] += count
531
- unread_counts ["all_pms " ] += count
531
+ unread_counts ["all_dms " ] += count
532
532
533
533
return unread_counts
534
534
0 commit comments