summary refs log tree commit diff
path: root/synapse/storage/event_federation.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-11-06 18:42:18 +0000
committerErik Johnston <erik@matrix.org>2014-11-07 10:53:38 +0000
commitbf6b72eb558cca94e209a541188079750bfefea0 (patch)
treea464449f4859cf0dabe262a97e12ff126ab6f703 /synapse/storage/event_federation.py
parentNeaten things up a bit (diff)
downloadsynapse-bf6b72eb558cca94e209a541188079750bfefea0.tar.xz
Start implementing auth chains
Diffstat (limited to 'synapse/storage/event_federation.py')
-rw-r--r--synapse/storage/event_federation.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/synapse/storage/event_federation.py b/synapse/storage/event_federation.py
index 180a764134..86c68ebf87 100644
--- a/synapse/storage/event_federation.py
+++ b/synapse/storage/event_federation.py
@@ -139,6 +139,27 @@ class EventFederationStore(SQLBaseStore):
 
         return results
 
+    def _get_auth_events(self, txn, event_id):
+        auth_ids = self._simple_select_onecol_txn(
+            txn,
+            table="event_auth",
+            keyvalues={
+                "event_id": event_id,
+            },
+            retcol="auth_id",
+        )
+
+        results = []
+        for auth_id in auth_ids:
+            hashes = self._get_event_reference_hashes_txn(txn, auth_id)
+            prev_hashes = {
+                k: encode_base64(v) for k, v in hashes.items()
+                if k == "sha256"
+            }
+            results.append((auth_id, prev_hashes))
+
+        return results
+
     def get_min_depth(self, room_id):
         return self.runInteraction(
             "get_min_depth",