File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -783,11 +783,17 @@ def get_stream_by_id(streams: List[StreamData], stream_id: int
783
783
sort_streams (self .pinned_streams )
784
784
self .controller .view .left_panel .update_stream_view ()
785
785
self .controller .update_screen ()
786
- elif (event ['op' ] in ('peer_add' , 'peer_remove' )
787
- and self .is_user_subscribed_to_stream (event ['stream_id' ])):
786
+ elif event ['op' ] in ('peer_add' , 'peer_remove' ):
788
787
action_map = dict (peer_add = 'append' , peer_remove = 'remove' )
789
- peers = self .stream_dict [event ['stream_id' ]]['subscribers' ]
790
- getattr (peers , action_map [event ['op' ]])(event ['user_id' ])
788
+ peers_action = action_map [event ['op' ]]
789
+ stream_ids = [event ['stream_id' ]]
790
+ user_ids = [event ['user_id' ]]
791
+ for stream_id in stream_ids :
792
+ if self .is_user_subscribed_to_stream (stream_id ):
793
+ peers = self .stream_dict [stream_id ]['subscribers' ]
794
+ action = getattr (peers , peers_action )
795
+ for user_id in user_ids :
796
+ action (user_id )
791
797
792
798
def _handle_typing_event (self , event : Event ) -> None :
793
799
"""
You can’t perform that action at this time.
0 commit comments