@@ -282,6 +282,7 @@ def set_narrow(
282
282
topic : Optional [str ] = None ,
283
283
pms : bool = False ,
284
284
pm_with : Optional [str ] = None ,
285
+ stream_messages : bool = False ,
285
286
starred : bool = False ,
286
287
mentioned : bool = False ,
287
288
active_button : Any = None ,
@@ -292,6 +293,7 @@ def set_narrow(
292
293
frozenset (["stream" ]): [["stream" , stream ]],
293
294
frozenset (["stream" , "topic" ]): [["stream" , stream ], ["topic" , topic ]],
294
295
frozenset (["pms" ]): [["is" , "private" ]],
296
+ frozenset (["stream_messages" ]): [["is" , "stream_messages" ]],
295
297
frozenset (["pm_with" ]): [["pm_with" , pm_with ]],
296
298
frozenset (["starred" ]): [["is" , "starred" ]],
297
299
frozenset (["mentioned" ]): [["is" , "mentioned" ]],
@@ -365,13 +367,18 @@ def get_message_ids_in_current_narrow(self) -> Set[int]:
365
367
ids = index ["topic_msg_ids" ][stream_id ].get (topic , set ())
366
368
elif narrow [0 ][1 ] == "private" :
367
369
ids = index ["private_msg_ids" ]
370
+ elif narrow [0 ][1 ] == "stream_messages" :
371
+ stream_ids = [ids for ids in index ["all_msg_ids" ] if ids not in index ["private_msg_ids" ]]
372
+ index ["stream_msg_ids" ] = stream_ids
373
+ ids = stream_ids
368
374
elif narrow [0 ][0 ] == "pm_with" :
369
375
recipients = self .recipients
370
376
ids = index ["private_msg_ids_by_user_ids" ].get (recipients , set ())
371
- elif narrow [0 ][1 ] == "starred" :
377
+ elif narrow [0 ][1 ] == "starred" :
372
378
ids = index ["starred_msg_ids" ]
373
379
elif narrow [0 ][1 ] == "mentioned" :
374
380
ids = index ["mentioned_msg_ids" ]
381
+
375
382
return ids .copy ()
376
383
377
384
def current_narrow_contains_message (self , message : Message ) -> bool :
0 commit comments