2024-05-08 15:48:59 +00:00
|
|
|
from twisted.test.proto_helpers import MemoryReactor
|
2024-05-07 23:16:35 +00:00
|
|
|
|
2024-05-08 15:48:59 +00:00
|
|
|
from synapse.server import HomeServer
|
|
|
|
from synapse.types import JsonDict
|
|
|
|
from synapse.util import Clock
|
2024-05-07 23:16:35 +00:00
|
|
|
|
2024-05-08 15:48:59 +00:00
|
|
|
from tests.rest.client.test_sendtodevice import SendToDeviceTestCase
|
2024-05-07 23:16:35 +00:00
|
|
|
|
|
|
|
|
2024-05-08 15:54:54 +00:00
|
|
|
# Test To-Device messages working correctly with the `/sync/e2ee` endpoint (`to_device`)
|
|
|
|
class SlidingSyncE2eeSendToDeviceTestCase(SendToDeviceTestCase):
|
2024-05-07 23:16:35 +00:00
|
|
|
def default_config(self) -> JsonDict:
|
|
|
|
config = super().default_config()
|
2024-05-08 15:48:59 +00:00
|
|
|
# Enable sliding sync
|
2024-05-07 23:16:35 +00:00
|
|
|
config["experimental_features"] = {"msc3575_enabled": True}
|
|
|
|
return config
|
|
|
|
|
2024-05-08 15:48:59 +00:00
|
|
|
def prepare(self, reactor: MemoryReactor, clock: Clock, hs: HomeServer) -> None:
|
|
|
|
# Use the Sliding Sync `/sync/e2ee` endpoint
|
|
|
|
self.sync_endpoint = "/_matrix/client/unstable/org.matrix.msc3575/sync/e2ee"
|
2024-05-07 23:16:35 +00:00
|
|
|
|
2024-05-08 15:54:54 +00:00
|
|
|
# See SendToDeviceTestCase for tests
|