Skip to content
Snippets Groups Projects
Commit 6d19fe14 authored by Erik Johnston's avatar Erik Johnston
Browse files

Fix generation of event ids so that they are consistent between local and remote ids

parent 781ff713
No related branches found
No related tags found
No related merge requests found
......@@ -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())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment