summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2018-02-13 18:07:10 +0000
committerGitHub <noreply@github.com>2018-02-13 18:07:10 +0000
commitc0c9327fe009da05a90985bc9c3f9f7acd145eaa (patch)
treecadb1ace409f9432069abe86f8fbba250480c609 /synapse/storage
parentFix log message in purge_history (diff)
parentUpdate docs (diff)
downloadsynapse-c0c9327fe009da05a90985bc9c3f9f7acd145eaa.tar.xz
Merge pull request #2854 from matrix-org/erikj/event_create_worker
Create a worker for event creation
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/appservice.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/synapse/storage/appservice.py b/synapse/storage/appservice.py
index d8c84b7141..79673b4273 100644
--- a/synapse/storage/appservice.py
+++ b/synapse/storage/appservice.py
@@ -99,6 +99,19 @@ class ApplicationServiceStore(SQLBaseStore):
                 return service
         return None
 
+    def get_app_service_by_id(self, as_id):
+        """Get the application service with the given appservice ID.
+
+        Args:
+            as_id (str): The application service ID.
+        Returns:
+            synapse.appservice.ApplicationService or None.
+        """
+        for service in self.services_cache:
+            if service.id == as_id:
+                return service
+        return None
+
     def get_app_service_rooms(self, service):
         """Get a list of RoomsForUser for this application service.