diff options
author | Erik Johnston <erik@matrix.org> | 2015-08-18 10:43:50 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-08-18 10:43:50 +0100 |
commit | dc2a105fcabbf4b3add2b127ce99742fa6e440a9 (patch) | |
tree | 806adbe5f0ec5493875d4816e208f596d8e9ba36 /synapse/handlers/message.py | |
parent | Merge pull request #208 from matrix-org/markjh/end-to-end-key-federation (diff) | |
parent | More helpful variable names (diff) | |
download | synapse-dc2a105fcabbf4b3add2b127ce99742fa6e440a9.tar.xz |
Merge pull request #226 from matrix-org/erikj/room_presence
Add and use cached batched storage.get_state function.
Diffstat (limited to 'synapse/handlers/message.py')
-rw-r--r-- | synapse/handlers/message.py | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py index 29e81085d1..f12465fa2c 100644 --- a/synapse/handlers/message.py +++ b/synapse/handlers/message.py @@ -460,20 +460,14 @@ class MessageHandler(BaseHandler): @defer.inlineCallbacks def get_presence(): - 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, - ) - for m in room_members - ], - consumeErrors=True, + states = yield presence_handler.get_states( + target_users=[UserID.from_string(m.user_id) for m in room_members], + auth_user=auth_user, + as_event=True, + check_auth=False, ) - defer.returnValue([p for success, p in presence_defs if success]) + defer.returnValue(states.values()) receipts_handler = self.hs.get_handlers().receipts_handler |