diff options
author | Erik Johnston <erik@matrix.org> | 2014-09-01 20:28:11 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2014-09-01 20:28:11 +0100 |
commit | a85612baf834e805d9174cd2e0c45c3d2b4b74f5 (patch) | |
tree | b9c869901d2252c42cc7a571411046f16078f2f0 /synapse/api/events/__init__.py | |
parent | Update readme with instructions on how to generate configs for homeservers (diff) | |
parent | Don't put required power levels on permission state events (diff) | |
download | synapse-a85612baf834e805d9174cd2e0c45c3d2b4b74f5.tar.xz |
Merge branch 'room_config' into develop
Diffstat (limited to 'synapse/api/events/__init__.py')
-rw-r--r-- | synapse/api/events/__init__.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/synapse/api/events/__init__.py b/synapse/api/events/__init__.py index f9653e0b2a..9502f5df8f 100644 --- a/synapse/api/events/__init__.py +++ b/synapse/api/events/__init__.py @@ -42,6 +42,7 @@ class SynapseEvent(JsonEncodedObject): "user_id", # sender/initiator "content", # HTTP body, JSON "state_key", + "required_power_level", ] internal_keys = [ @@ -52,6 +53,7 @@ class SynapseEvent(JsonEncodedObject): "destinations", "origin", "outlier", + "power_level", ] required_keys = [ @@ -152,3 +154,10 @@ class SynapseEvent(JsonEncodedObject): msg = self._check_json(entry, template[key][0]) if msg: return msg + + +class SynapseStateEvent(SynapseEvent): + def __init__(self, **kwargs): + if "state_key" not in kwargs: + kwargs["state_key"] = "" + super(SynapseStateEvent, self).__init__(**kwargs) |