Skip to content

Commit

Permalink
more robust handling of emit's "to" argument (Fixes #689)
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed May 22, 2021
1 parent 0e18945 commit 2f0d8bb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions socketio/base_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ def get_namespaces(self):
def get_participants(self, namespace, room):
"""Return an iterable with the active participants in a room."""
ns = self.rooms[namespace]
if room is None or isinstance(room, str):
participants = ns[room]._fwdm.copy() if room in ns else {}
else:
if hasattr(room, '__len__') and not isinstance(room, str):
participants = ns[room[0]]._fwdm.copy() if room[0] in ns else {}
for r in room[1:]:
participants.update(ns[r]._fwdm if r in ns else {})
else:
participants = ns[room]._fwdm.copy() if room in ns else {}
for sid, eio_sid in participants.items():
yield sid, eio_sid

Expand Down

0 comments on commit 2f0d8bb

Please sign in to comment.