Convert event ids to be of the form :example.com

This commit is contained in:
Erik Johnston 2014-10-30 17:00:11 +00:00
parent da511334d2
commit 12ce441e67
6 changed files with 54 additions and 28 deletions

View file

@ -21,6 +21,8 @@ from synapse.api.events.room import (
RoomRedactionEvent,
)
from synapse.types import EventID
from synapse.util.stringutils import random_string
@ -59,7 +61,9 @@ class EventFactory(object):
local_part = str(int(self.clock.time())) + i + random_string(5)
return "%s@%s" % (local_part, self.hs.hostname)
e_id = EventID.create_local(local_part, self.hs)
return e_id.to_string()
def create_event(self, etype=None, **kwargs):
kwargs["type"] = etype