Use DeferredList

This commit is contained in:
Erik Johnston 2015-06-16 17:03:24 +01:00
parent 0460406298
commit b849a64f8d
1 changed files with 9 additions and 9 deletions

View File

@ -396,20 +396,20 @@ 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()