summary refs log tree commit diff
path: root/synapse/events
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-12-10 14:02:48 +0000
committerErik Johnston <erik@matrix.org>2014-12-10 14:02:48 +0000
commit02db7eb209af879a0168a371b4cb1c2ad0fcab49 (patch)
tree27535103af5903aa66c4561c02cbc24f5a013fd7 /synapse/events
parentMerge branch 'develop' of github.com:matrix-org/synapse into events_refactor (diff)
downloadsynapse-02db7eb209af879a0168a371b4cb1c2ad0fcab49.tar.xz
Fix bug when uploading state with empty state_key
Diffstat (limited to 'synapse/events')
-rw-r--r--synapse/events/__init__.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/synapse/events/__init__.py b/synapse/events/__init__.py
index 5f41933174..bd3ffb59cc 100644
--- a/synapse/events/__init__.py
+++ b/synapse/events/__init__.py
@@ -118,6 +118,9 @@ class EventBase(object):
 
         return d
 
+    def get(self, key, default):
+        return self._event_dict.get(key, default)
+
     def get_internal_metadata_dict(self):
         return self.internal_metadata.get_dict()
 
@@ -165,6 +168,9 @@ class FrozenEvent(EventBase):
         return _unfreeze(super(FrozenEvent, self).get_dict())
 
     def __str__(self):
+        return self.__repr__()
+
+    def __repr__(self):
         return "<FrozenEvent event_id='%s', type='%s', state_key='%s'>" % (
-            self.event_id, self.type, self.state_key,
-        )
+            self.event_id, self.type, self.get("state_key", None),
+        )
\ No newline at end of file