diff options
author | Matthew Hodgson <matthew@matrix.org> | 2016-02-10 16:27:15 +0000 |
---|---|---|
committer | Matthew Hodgson <matthew@matrix.org> | 2016-02-10 16:27:15 +0000 |
commit | 76346870571ce885d07b180cf88c11a33a051cf8 (patch) | |
tree | 832664ad8351517a43bd91230eeacf257b2c0bec /synapse/events | |
parent | try to bump syweb to 0.6.8 (diff) | |
parent | Merge branch 'release-v0.13.0' of github.com:matrix-org/synapse (diff) | |
download | synapse-76346870571ce885d07b180cf88c11a33a051cf8.tar.xz |
Merge branch 'master' of git+ssh://github.com/matrix-org/synapse
Diffstat (limited to 'synapse/events')
-rw-r--r-- | synapse/events/__init__.py | 11 | ||||
-rw-r--r-- | synapse/events/builder.py | 2 | ||||
-rw-r--r-- | synapse/events/snapshot.py | 3 | ||||
-rw-r--r-- | synapse/events/utils.py | 2 | ||||
-rw-r--r-- | synapse/events/validator.py | 2 |
5 files changed, 15 insertions, 5 deletions
diff --git a/synapse/events/__init__.py b/synapse/events/__init__.py index 3fb4b5e791..bbfa5a7265 100644 --- a/synapse/events/__init__.py +++ b/synapse/events/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2014, 2015 OpenMarket Ltd +# Copyright 2014-2016 OpenMarket Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -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): diff --git a/synapse/events/builder.py b/synapse/events/builder.py index 9d45bdb892..7369d70980 100644 --- a/synapse/events/builder.py +++ b/synapse/events/builder.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2014, 2015 OpenMarket Ltd +# Copyright 2014-2016 OpenMarket Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/synapse/events/snapshot.py b/synapse/events/snapshot.py index 4ecadf0879..8a475417a6 100644 --- a/synapse/events/snapshot.py +++ b/synapse/events/snapshot.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2014, 2015 OpenMarket Ltd +# Copyright 2014-2016 OpenMarket Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -20,3 +20,4 @@ class EventContext(object): self.current_state = current_state self.state_group = None self.rejected = False + self.push_actions = [] diff --git a/synapse/events/utils.py b/synapse/events/utils.py index e634b149ba..aab18d7f71 100644 --- a/synapse/events/utils.py +++ b/synapse/events/utils.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2014, 2015 OpenMarket Ltd +# Copyright 2014-2016 OpenMarket Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/synapse/events/validator.py b/synapse/events/validator.py index 0ee6872d1e..2f4c8a1018 100644 --- a/synapse/events/validator.py +++ b/synapse/events/validator.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2014, 2015 OpenMarket Ltd +# Copyright 2014-2016 OpenMarket Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. |