mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
Use DeferredList
This commit is contained in:
parent
0460406298
commit
b849a64f8d
@ -396,20 +396,20 @@ class MessageHandler(BaseHandler):
|
||||
]
|
||||
|
||||
presence_handler = self.hs.get_handlers().presence_handler
|
||||
presence = []
|
||||
for m in room_members:
|
||||
try:
|
||||
member_presence = yield presence_handler.get_state(
|
||||
presence_defs = yield defer.DeferredList(
|
||||
[
|
||||
presence_handler.get_state(
|
||||
target_user=UserID.from_string(m.user_id),
|
||||
auth_user=auth_user,
|
||||
as_event=True,
|
||||
check_auth=False,
|
||||
)
|
||||
presence.append(member_presence)
|
||||
except SynapseError:
|
||||
logger.exception(
|
||||
"Failed to get member presence of %r", m.user_id
|
||||
)
|
||||
for m in room_members
|
||||
],
|
||||
consumeErrors=True,
|
||||
)
|
||||
|
||||
presence = [p for success, p in presence_defs if success]
|
||||
|
||||
time_now = self.clock.time_msec()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user