summary refs log tree commit diff
path: root/synapse/storage/__init__.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/__init__.py
parentNeaten things up a bit (diff)
downloadsynapse-bf6b72eb558cca94e209a541188079750bfefea0.tar.xz
Start implementing auth chains
Diffstat (limited to 'synapse/storage/__init__.py')
-rw-r--r--synapse/storage/__init__.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/synapse/storage/__init__.py b/synapse/storage/__init__.py
index 2a1970914f..48ad4d864f 100644
--- a/synapse/storage/__init__.py
+++ b/synapse/storage/__init__.py
@@ -19,7 +19,6 @@ from synapse.api.events.room import (
     RoomMemberEvent, RoomTopicEvent, FeedbackEvent,
     RoomNameEvent,
     RoomJoinRulesEvent,
-    RoomPowerLevelsEvent,
     RoomRedactionEvent,
 )
 
@@ -302,6 +301,17 @@ class DataStore(RoomMemberStore, RoomStore,
                     txn, event.event_id, prev_event_id, alg, hash_bytes
                 )
 
+        for auth_id, _ in event.auth_events:
+            self._simple_insert_txn(
+                txn,
+                table="event_auth",
+                values={
+                    "event_id": event.event_id,
+                    "room_id": event.room_id,
+                    "auth_id": auth_id,
+                },
+            )
+
         (ref_alg, ref_hash_bytes) = compute_event_reference_hash(event)
         self._store_event_reference_hash_txn(
             txn, event.event_id, ref_alg, ref_hash_bytes