diff options
author | David Baker <dave@matrix.org> | 2014-12-18 15:15:22 +0000 |
---|---|---|
committer | David Baker <dave@matrix.org> | 2014-12-18 15:15:22 +0000 |
commit | b56730bb6e549e6b22c95858cae50e091de96844 (patch) | |
tree | 0eb011bc6b32a44df8c343ffedbc15e2ddd046e9 /synapse/server.py | |
parent | schema version is now 10 (diff) | |
parent | Update README.rst (diff) | |
download | synapse-b56730bb6e549e6b22c95858cae50e091de96844.tar.xz |
Merge branch 'develop' into pushers
Conflicts: synapse/api/errors.py synapse/server.py synapse/storage/__init__.py
Diffstat (limited to 'synapse/server.py')
-rw-r--r-- | synapse/server.py | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/synapse/server.py b/synapse/server.py index cfbe7d5e38..b7d6811449 100644 --- a/synapse/server.py +++ b/synapse/server.py @@ -20,9 +20,7 @@ # Imports required for the default HomeServer() implementation from synapse.federation import initialize_http_replication -from synapse.api.events import serialize_event -from synapse.api.events.factory import EventFactory -from synapse.api.events.validator import EventValidator +from synapse.events.utils import serialize_event from synapse.notifier import Notifier from synapse.api.auth import Auth from synapse.handlers import Handlers @@ -37,6 +35,7 @@ from synapse.streams.events import EventSources from synapse.api.ratelimiting import Ratelimiter from synapse.crypto.keyring import Keyring from synapse.push.pusherpool import PusherPool +from synapse.events.builder import EventBuilderFactory class BaseHomeServer(object): @@ -66,7 +65,6 @@ class BaseHomeServer(object): 'persistence_service', 'replication_layer', 'datastore', - 'event_factory', 'handlers', 'auth', 'rest_servlet_factory', @@ -79,11 +77,12 @@ class BaseHomeServer(object): 'resource_for_web_client', 'resource_for_content_repo', 'resource_for_server_key', + 'resource_for_media_repository', 'event_sources', 'ratelimiter', 'keyring', - 'event_validator', - 'pusherpool' + 'pusherpool', + 'event_builder_factory', ] def __init__(self, hostname, **kwargs): @@ -135,22 +134,22 @@ class BaseHomeServer(object): def parse_userid(self, s): """Parse the string given by 's' as a User ID and return a UserID object.""" - return UserID.from_string(s, hs=self) + return UserID.from_string(s) def parse_roomalias(self, s): """Parse the string given by 's' as a Room Alias and return a RoomAlias object.""" - return RoomAlias.from_string(s, hs=self) + return RoomAlias.from_string(s) def parse_roomid(self, s): """Parse the string given by 's' as a Room ID and return a RoomID object.""" - return RoomID.from_string(s, hs=self) + return RoomID.from_string(s) def parse_eventid(self, s): """Parse the string given by 's' as a Event ID and return a EventID object.""" - return EventID.from_string(s, hs=self) + return EventID.from_string(s) def serialize_event(self, e): return serialize_event(self, e) @@ -167,6 +166,9 @@ class BaseHomeServer(object): return ip_addr + def is_mine(self, domain_specific_string): + return domain_specific_string.domain == self.hostname + # Build magic accessors for every dependency for depname in BaseHomeServer.DEPENDENCIES: BaseHomeServer._make_dependency_method(depname) @@ -194,9 +196,6 @@ class HomeServer(BaseHomeServer): def build_datastore(self): return DataStore(self) - def build_event_factory(self): - return EventFactory(self) - def build_handlers(self): return Handlers(self) @@ -227,8 +226,11 @@ class HomeServer(BaseHomeServer): def build_keyring(self): return Keyring(self) - def build_event_validator(self): - return EventValidator(self) + def build_event_builder_factory(self): + return EventBuilderFactory( + clock=self.get_clock(), + hostname=self.hostname, + ) def build_pusherpool(self): return PusherPool(self) |