diff options
author | Erik Johnston <erik@matrix.org> | 2014-11-03 11:32:42 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2014-11-03 11:32:42 +0000 |
commit | 0a8b026ccf2d2472bb14303eaf5af8b8cf0efa5d (patch) | |
tree | d2632896457056ece09f3f291dcb1f76264e4ccc | |
parent | Don't assume event has hashes key already (diff) | |
download | synapse-0a8b026ccf2d2472bb14303eaf5af8b8cf0efa5d.tar.xz |
Add 'origin' key to events
-rw-r--r-- | synapse/api/events/factory.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/api/events/factory.py b/synapse/api/events/factory.py index 750096c618..9134c82eff 100644 --- a/synapse/api/events/factory.py +++ b/synapse/api/events/factory.py @@ -69,6 +69,10 @@ class EventFactory(object): kwargs["type"] = etype if "event_id" not in kwargs: kwargs["event_id"] = self.create_event_id() + kwargs["origin"] = self.hs.hostname + else: + ev_id = self.hs.parse_eventid(kwargs["event_id"]) + kwargs["origin"] = ev_id.domain if "origin_server_ts" not in kwargs: kwargs["origin_server_ts"] = int(self.clock.time_msec()) |