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