File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -403,12 +403,14 @@ def index_messages(messages: List[Message],
403403 (index ['stream_msg_ids_by_stream_id' ][msg ['stream_id' ]]
404404 .add (msg ['id' ]))
405405
406- if (msg ['type' ] == 'stream' and len (narrow ) == 2
407- and narrow [1 ][1 ] == msg ['subject' ]):
408- topics_in_stream = index ['topic_msg_ids' ][msg ['stream_id' ]]
409- if not topics_in_stream .get (msg ['subject' ]):
410- topics_in_stream [msg ['subject' ]] = set ()
411- topics_in_stream [msg ['subject' ]].add (msg ['id' ])
406+ if msg ['type' ] == 'stream' and len (narrow ) == 2 :
407+ narrow_topic = narrow [1 ][1 ]
408+ msg_topic = msg ['subject' ]
409+ if narrow_topic == msg_topic :
410+ topics_in_stream = index ['topic_msg_ids' ][msg ['stream_id' ]]
411+ if not topics_in_stream .get (msg_topic ):
412+ topics_in_stream [msg_topic ] = set ()
413+ topics_in_stream [msg_topic ].add (msg ['id' ])
412414
413415 return index
414416
You can’t perform that action at this time.
0 commit comments