summary refs log tree commit diff
path: root/synapse/storage/databases/main/transactions.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2022-01-19 10:59:51 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2022-01-19 10:59:51 +0000
commit20d441848571384622a573f749f9772becf855e7 (patch)
tree82d7fc5028740641eb2bcc52d564a132ed3357cc /synapse/storage/databases/main/transactions.py
parentMerge branch 'release-v1.50' into matrix-org-hotfixes (diff)
parentFix preview of imgur and Tenor URLs. (#11669) (diff)
downloadsynapse-20d441848571384622a573f749f9772becf855e7.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes
Diffstat (limited to 'synapse/storage/databases/main/transactions.py')
-rw-r--r--synapse/storage/databases/main/transactions.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/synapse/storage/databases/main/transactions.py b/synapse/storage/databases/main/transactions.py

index 6c299cafa5..4b78b4d098 100644 --- a/synapse/storage/databases/main/transactions.py +++ b/synapse/storage/databases/main/transactions.py
@@ -560,3 +560,14 @@ class TransactionWorkerStore(CacheInvalidationWorkerStore): return await self.db_pool.runInteraction( "get_destinations_paginate_txn", get_destinations_paginate_txn ) + + async def is_destination_known(self, destination: str) -> bool: + """Check if a destination is known to the server.""" + result = await self.db_pool.simple_select_one_onecol( + table="destinations", + keyvalues={"destination": destination}, + retcol="1", + allow_none=True, + desc="is_destination_known", + ) + return bool(result)