mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 21:54:53 -04:00
Convert event ids to be of the form :example.com
This commit is contained in:
parent
da511334d2
commit
12ce441e67
6 changed files with 54 additions and 28 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue