mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 21:34:51 -04:00
Use ApplicationService when registering.
This commit is contained in:
parent
92171f9dd1
commit
ec3719b583
3 changed files with 17 additions and 20 deletions
|
@ -30,21 +30,18 @@ class ApplicationServicesHandler(BaseHandler):
|
|||
super(ApplicationServicesHandler, self).__init__(hs)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def register(self, base_url, token, namespaces):
|
||||
def register(self, app_service):
|
||||
# check the token is recognised
|
||||
try:
|
||||
app_service = yield self.store.get_app_service(token)
|
||||
if not app_service:
|
||||
raise StoreError
|
||||
stored_service = yield self.store.get_app_service(app_service.token)
|
||||
if not stored_service:
|
||||
raise StoreError(404, "Not found")
|
||||
except StoreError:
|
||||
raise SynapseError(
|
||||
403, "Unrecognised application services token. "
|
||||
"Consult the home server admin."
|
||||
)
|
||||
|
||||
# store this AS
|
||||
|
||||
defer.returnValue("not_implemented_yet")
|
||||
# TODO store this AS
|
||||
|
||||
def unregister(self, token):
|
||||
yield self.store.unregister_app_service(token)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue