diff options
author | Erik Johnston <erik@matrix.org> | 2014-12-10 14:02:48 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2014-12-10 14:02:48 +0000 |
commit | 02db7eb209af879a0168a371b4cb1c2ad0fcab49 (patch) | |
tree | 27535103af5903aa66c4561c02cbc24f5a013fd7 /synapse/events | |
parent | Merge branch 'develop' of github.com:matrix-org/synapse into events_refactor (diff) | |
download | synapse-02db7eb209af879a0168a371b4cb1c2ad0fcab49.tar.xz |
Fix bug when uploading state with empty state_key
Diffstat (limited to 'synapse/events')
-rw-r--r-- | synapse/events/__init__.py | 10 |
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 |