mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 10:16:07 -04:00
Implement a batched presence_handler.get_state and use it
This commit is contained in:
parent
47abebfd6d
commit
1a9510bb84
3 changed files with 73 additions and 14 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue