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

@ -78,6 +78,11 @@ class DomainSpecificString(
"""Create a structure on the local domain"""
return cls(localpart=localpart, domain=hs.hostname, is_mine=True)
@classmethod
def create(cls, localpart, domain, hs):
is_mine = domain == hs.hostname
return cls(localpart=localpart, domain=domain, is_mine=is_mine)
class UserID(DomainSpecificString):
"""Structure representing a user ID."""
@ -94,6 +99,11 @@ class RoomID(DomainSpecificString):
SIGIL = "!"
class EventID(DomainSpecificString):
"""Structure representing an event id. """
SIGIL = "$"
class StreamToken(
namedtuple(
"Token",