summary refs log tree commit diff
path: root/synapse/api
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-10-30 17:00:11 +0000
committerErik Johnston <erik@matrix.org>2014-10-30 17:00:11 +0000
commit12ce441e67a40bb73ac5aca0283c2fe4afac4021 (patch)
tree0a4b6d32dc2a7f149153ad7868d5c5e117335859 /synapse/api
parentMake federation return the old current state, so that we can use it to do auth (diff)
downloadsynapse-12ce441e67a40bb73ac5aca0283c2fe4afac4021.tar.xz
Convert event ids to be of the form :example.com
Diffstat (limited to 'synapse/api')
-rw-r--r--synapse/api/events/factory.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/api/events/factory.py b/synapse/api/events/factory.py
index 06f3bf232b..750096c618 100644
--- a/synapse/api/events/factory.py
+++ b/synapse/api/events/factory.py
@@ -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