diff options
author | Erik Johnston <erik@matrix.org> | 2014-09-06 02:48:13 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2014-09-06 02:48:13 +0100 |
commit | 6d19fe1481820331355669ea35f46bcf6dbfd93b (patch) | |
tree | dc8b21ab6e447c7fa7e5f696f92b8bfd33d844d9 /synapse | |
parent | When getting a state event also include the previous content (diff) | |
download | synapse-6d19fe1481820331355669ea35f46bcf6dbfd93b.tar.xz |
Fix generation of event ids so that they are consistent between local and remote ids
Diffstat (limited to 'synapse')
-rw-r--r-- | synapse/api/events/factory.py | 5 |
1 files changed, 4 insertions, 1 deletions
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()) |