Fix endpoint improperly declaring support for MSC3814 (#16068)
This commit is contained in:
parent
81a6f8c9ae
commit
8af3f33d84
|
@ -0,0 +1 @@
|
||||||
|
Fix endpoint improperly declaring support for MSC3814.
|
|
@ -232,7 +232,7 @@ class DehydratedDeviceDataModel(RequestBodyModel):
|
||||||
class DehydratedDeviceServlet(RestServlet):
|
class DehydratedDeviceServlet(RestServlet):
|
||||||
"""Retrieve or store a dehydrated device.
|
"""Retrieve or store a dehydrated device.
|
||||||
|
|
||||||
Implements either MSC2697 or MSC3814.
|
Implements MSC2697.
|
||||||
|
|
||||||
GET /org.matrix.msc2697.v2/dehydrated_device
|
GET /org.matrix.msc2697.v2/dehydrated_device
|
||||||
|
|
||||||
|
@ -266,7 +266,12 @@ class DehydratedDeviceServlet(RestServlet):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, hs: "HomeServer", msc2697: bool = True):
|
PATTERNS = client_patterns(
|
||||||
|
"/org.matrix.msc2697.v2/dehydrated_device$",
|
||||||
|
releases=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
def __init__(self, hs: "HomeServer"):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.hs = hs
|
self.hs = hs
|
||||||
self.auth = hs.get_auth()
|
self.auth = hs.get_auth()
|
||||||
|
@ -274,13 +279,6 @@ class DehydratedDeviceServlet(RestServlet):
|
||||||
assert isinstance(handler, DeviceHandler)
|
assert isinstance(handler, DeviceHandler)
|
||||||
self.device_handler = handler
|
self.device_handler = handler
|
||||||
|
|
||||||
self.PATTERNS = client_patterns(
|
|
||||||
"/org.matrix.msc2697.v2/dehydrated_device$"
|
|
||||||
if msc2697
|
|
||||||
else "/org.matrix.msc3814.v1/dehydrated_device$",
|
|
||||||
releases=(),
|
|
||||||
)
|
|
||||||
|
|
||||||
async def on_GET(self, request: SynapseRequest) -> Tuple[int, JsonDict]:
|
async def on_GET(self, request: SynapseRequest) -> Tuple[int, JsonDict]:
|
||||||
requester = await self.auth.get_user_by_req(request)
|
requester = await self.auth.get_user_by_req(request)
|
||||||
dehydrated_device = await self.device_handler.get_dehydrated_device(
|
dehydrated_device = await self.device_handler.get_dehydrated_device(
|
||||||
|
@ -579,7 +577,7 @@ def register_servlets(hs: "HomeServer", http_server: HttpServer) -> None:
|
||||||
if hs.config.worker.worker_app is None:
|
if hs.config.worker.worker_app is None:
|
||||||
DeviceRestServlet(hs).register(http_server)
|
DeviceRestServlet(hs).register(http_server)
|
||||||
if hs.config.experimental.msc2697_enabled:
|
if hs.config.experimental.msc2697_enabled:
|
||||||
DehydratedDeviceServlet(hs, msc2697=True).register(http_server)
|
DehydratedDeviceServlet(hs).register(http_server)
|
||||||
ClaimDehydratedDeviceServlet(hs).register(http_server)
|
ClaimDehydratedDeviceServlet(hs).register(http_server)
|
||||||
if hs.config.experimental.msc3814_enabled:
|
if hs.config.experimental.msc3814_enabled:
|
||||||
DehydratedDeviceV2Servlet(hs).register(http_server)
|
DehydratedDeviceV2Servlet(hs).register(http_server)
|
||||||
|
|
Loading…
Reference in New Issue