summary refs log tree commit diff
path: root/synapse/events
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-01-19 11:27:27 +0000
committerErik Johnston <erik@matrix.org>2016-01-19 11:27:27 +0000
commit47e7963e50704a1a981b8c009f8403085be721a6 (patch)
tree1a8b4930d67c314c21d40e8e48436a0b246476f1 /synapse/events
parentMerge pull request #503 from matrix-org/daniel/nonghosts (diff)
parentTake a deepcopy of push rules before mutating them (diff)
downloadsynapse-47e7963e50704a1a981b8c009f8403085be721a6.tar.xz
Merge pull request #502 from matrix-org/erikj/push_notif_perf
Unread notification performance.
Diffstat (limited to 'synapse/events')
-rw-r--r--synapse/events/__init__.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/synapse/events/__init__.py b/synapse/events/__init__.py
index 869a623090..bbfa5a7265 100644
--- a/synapse/events/__init__.py
+++ b/synapse/events/__init__.py
@@ -117,6 +117,15 @@ class EventBase(object):
     def __set__(self, instance, value):
         raise AttributeError("Unrecognized attribute %s" % (instance,))
 
+    def __getitem__(self, field):
+        return self._event_dict[field]
+
+    def __contains__(self, field):
+        return field in self._event_dict
+
+    def items(self):
+        return self._event_dict.items()
+
 
 class FrozenEvent(EventBase):
     def __init__(self, event_dict, internal_metadata_dict={}, rejected_reason=None):