summary refs log tree commit diff
path: root/synapse/storage/presence.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-08-17 10:40:23 +0100
committerErik Johnston <erik@matrix.org>2015-08-17 10:40:23 +0100
commit1a9510bb84d79f6ff78d32390195bc97ed9a439e (patch)
treeb9ac0d1785e86d885e054070213c51428e9102f6 /synapse/storage/presence.py
parentAdd batched version of store.get_presence_state (diff)
downloadsynapse-1a9510bb84d79f6ff78d32390195bc97ed9a439e.tar.xz
Implement a batched presence_handler.get_state and use it
Diffstat (limited to '')
-rw-r--r--synapse/storage/presence.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/storage/presence.py b/synapse/storage/presence.py
index f351b76a70..15d98198e2 100644
--- a/synapse/storage/presence.py
+++ b/synapse/storage/presence.py
@@ -50,13 +50,15 @@ class PresenceStore(SQLBaseStore):
         def f(txn):
             results = {}
             for user_localpart in user_localparts:
-                results[user_localpart] = self._simple_select_one_txn(
+                res = self._simple_select_one_txn(
                     txn,
                     table="presence",
                     keyvalues={"user_id": user_localpart},
                     retcols=["state", "status_msg", "mtime"],
-                    desc="get_presence_state",
+                    allow_none=True,
                 )
+                if res:
+                    results[user_localpart] = res
 
             return results