mirror of
https://github.com/element-hq/synapse
synced 2024-10-06 10:02:39 +00:00
Configurable /sync/e2ee endpoint
This commit is contained in:
parent
3e6ee8ff88
commit
f9e6e53130
2 changed files with 26 additions and 0 deletions
|
@ -332,6 +332,9 @@ class ExperimentalConfig(Config):
|
|||
# MSC3391: Removing account data.
|
||||
self.msc3391_enabled = experimental.get("msc3391_enabled", False)
|
||||
|
||||
# MSC3575 (Sliding Sync API endpoints)
|
||||
self.msc3575_enabled: bool = experimental.get("msc3575_enabled", False)
|
||||
|
||||
# MSC3773: Thread notifications
|
||||
self.msc3773_enabled: bool = experimental.get("msc3773_enabled", False)
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
import itertools
|
||||
import logging
|
||||
from collections import defaultdict
|
||||
import re
|
||||
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union
|
||||
|
||||
from synapse.api.constants import AccountDataTypes, EduTypes, Membership, PresenceState
|
||||
|
@ -553,5 +554,27 @@ class SyncRestServlet(RestServlet):
|
|||
return result
|
||||
|
||||
|
||||
class SlidingSyncRestServlet(RestServlet):
|
||||
"""
|
||||
API endpoint TODO
|
||||
Useful for cases like TODO
|
||||
"""
|
||||
|
||||
PATTERNS = (re.compile("^/_matrix/client/unstable/org.matrix.msc3575/sync/e2ee$"),)
|
||||
|
||||
def __init__(self, hs: "HomeServer"):
|
||||
super().__init__()
|
||||
self._auth = hs.get_auth()
|
||||
self.store = hs.get_datastores().main
|
||||
|
||||
async def on_GET(self, request: SynapseRequest) -> Tuple[int, JsonDict]:
|
||||
return 200, {
|
||||
"foo": "bar",
|
||||
}
|
||||
|
||||
|
||||
def register_servlets(hs: "HomeServer", http_server: HttpServer) -> None:
|
||||
SyncRestServlet(hs).register(http_server)
|
||||
|
||||
if hs.config.experimental.msc3575_enabled:
|
||||
SlidingSyncRestServlet(hs).register(http_server)
|
||||
|
|
Loading…
Reference in a new issue