summary refs log tree commit diff
path: root/synapse/api/events
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-09-06 18:18:55 +0100
committerErik Johnston <erik@matrix.org>2014-09-06 18:18:55 +0100
commitd12feed6235ec91e9797a47c98e9da162b6559c9 (patch)
tree57f47c24ee7a402f210d7cb07f08521dfba6867c /synapse/api/events
parentMinor spec tweaks. (diff)
parentCenter recaptcha dialog. (diff)
downloadsynapse-d12feed6235ec91e9797a47c98e9da162b6559c9.tar.xz
Merge branch 'release-v0.2.2' of github.com:matrix-org/synapse v0.2.2
Diffstat (limited to 'synapse/api/events')
-rw-r--r--synapse/api/events/__init__.py7
-rw-r--r--synapse/api/events/factory.py5
-rw-r--r--synapse/api/events/room.py7
3 files changed, 17 insertions, 2 deletions
diff --git a/synapse/api/events/__init__.py b/synapse/api/events/__init__.py

index f95468fc65..5f300de108 100644 --- a/synapse/api/events/__init__.py +++ b/synapse/api/events/__init__.py
@@ -157,7 +157,12 @@ class SynapseEvent(JsonEncodedObject): class SynapseStateEvent(SynapseEvent): - def __init__(self, **kwargs): + + valid_keys = SynapseEvent.valid_keys + [ + "prev_content", + ] + + def __init__(self, **kwargs): if "state_key" not in kwargs: kwargs["state_key"] = "" super(SynapseStateEvent, self).__init__(**kwargs) diff --git a/synapse/api/events/factory.py b/synapse/api/events/factory.py
index a3b293e024..5e38cdbc44 100644 --- a/synapse/api/events/factory.py +++ b/synapse/api/events/factory.py
@@ -47,11 +47,14 @@ class EventFactory(object): self._event_list[event_class.TYPE] = event_class self.clock = hs.get_clock() + self.hs = hs def create_event(self, etype=None, **kwargs): kwargs["type"] = etype if "event_id" not in kwargs: - kwargs["event_id"] = random_string(10) + kwargs["event_id"] = "%s@%s" % ( + random_string(10), self.hs.hostname + ) if "ts" not in kwargs: kwargs["ts"] = int(self.clock.time_msec()) diff --git a/synapse/api/events/room.py b/synapse/api/events/room.py
index 33f0f0cb99..3a4dbc58ce 100644 --- a/synapse/api/events/room.py +++ b/synapse/api/events/room.py
@@ -173,3 +173,10 @@ class RoomOpsPowerLevelsEvent(SynapseStateEvent): def get_content_template(self): return {} + + +class RoomAliasesEvent(SynapseStateEvent): + TYPE = "m.room.aliases" + + def get_content_template(self): + return {}