summary refs log tree commit diff
path: root/synapse/events
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-12-04 15:50:01 +0000
committerErik Johnston <erik@matrix.org>2014-12-04 15:50:01 +0000
commitc31dba86ec40853f27c70ae13409ca3332052cc1 (patch)
treeab5a11519590c3c8e2211aedd2b441a7ccc759d5 /synapse/events
parentBegin converting things to use the new Event structure (diff)
downloadsynapse-c31dba86ec40853f27c70ae13409ca3332052cc1.tar.xz
Convert rest and handlers to use new event structure
Diffstat (limited to 'synapse/events')
-rw-r--r--synapse/events/__init__.py8
-rw-r--r--synapse/events/builder.py5
2 files changed, 8 insertions, 5 deletions
diff --git a/synapse/events/__init__.py b/synapse/events/__init__.py
index 6a05ba2d16..58edf2bc8f 100644
--- a/synapse/events/__init__.py
+++ b/synapse/events/__init__.py
@@ -85,10 +85,10 @@ class EventBase(object):
         return hasattr(self, "state_key")
 
     def get_dict(self):
-        d = dict(self._original)
+        d = dict(self._event_dict)
         d.update({
-            "signatures": self._signatures,
-            "unsigned": self._unsigned,
+            "signatures": self.signatures,
+            "unsigned": self.unsigned,
         })
 
         return d
@@ -128,7 +128,7 @@ class FrozenEvent(EventBase):
     @staticmethod
     def from_event(event):
         e = FrozenEvent(
-            event.event_dict()
+            event.get_pdu_json()
         )
 
         e.internal_metadata = event.internal_metadata
diff --git a/synapse/events/builder.py b/synapse/events/builder.py
index 39b4d2a2ab..0b8caf9318 100644
--- a/synapse/events/builder.py
+++ b/synapse/events/builder.py
@@ -22,10 +22,13 @@ from synapse.util.stringutils import random_string
 
 class EventBuilder(EventBase):
     def __init__(self, key_values={}):
-        super(FrozenEvent, self).__init__(
+        super(EventBuilder, self).__init__(
             key_values,
         )
 
+    def update_event_key(self, key, value):
+        self._event_dict[key] = value
+
     def update_event_keys(self, other_dict):
         self._event_dict.update(other_dict)