experimental.py 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # Copyright 2021 The Matrix.org Foundation C.I.C.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. from synapse.config._base import Config
  15. from synapse.types import JsonDict
  16. class ExperimentalConfig(Config):
  17. """Config section for enabling experimental features"""
  18. section = "experimental"
  19. def read_config(self, config: JsonDict, **kwargs):
  20. experimental = config.get("experimental_features") or {}
  21. # MSC3440 (thread relation)
  22. self.msc3440_enabled: bool = experimental.get("msc3440_enabled", False)
  23. # MSC3666: including bundled relations in /search.
  24. self.msc3666_enabled: bool = experimental.get("msc3666_enabled", False)
  25. # MSC3026 (busy presence state)
  26. self.msc3026_enabled: bool = experimental.get("msc3026_enabled", False)
  27. # MSC2716 (importing historical messages)
  28. self.msc2716_enabled: bool = experimental.get("msc2716_enabled", False)
  29. # MSC2285 (hidden read receipts)
  30. self.msc2285_enabled: bool = experimental.get("msc2285_enabled", False)
  31. # MSC3244 (room version capabilities)
  32. self.msc3244_enabled: bool = experimental.get("msc3244_enabled", True)
  33. # MSC3266 (room summary api)
  34. self.msc3266_enabled: bool = experimental.get("msc3266_enabled", False)
  35. # MSC3030 (Jump to date API endpoint)
  36. self.msc3030_enabled: bool = experimental.get("msc3030_enabled", False)
  37. # MSC2409 (this setting only relates to optionally sending to-device messages).
  38. # Presence, typing and read receipt EDUs are already sent to application services that
  39. # have opted in to receive them. If enabled, this adds to-device messages to that list.
  40. self.msc2409_to_device_messages_enabled: bool = experimental.get(
  41. "msc2409_to_device_messages_enabled", False
  42. )
  43. # The portion of MSC3202 which is related to device masquerading.
  44. self.msc3202_device_masquerading_enabled: bool = experimental.get(
  45. "msc3202_device_masquerading", False
  46. )
  47. # Portion of MSC3202 related to transaction extensions:
  48. # sending one-time key counts and fallback key usage to application services.
  49. self.msc3202_transaction_extensions: bool = experimental.get(
  50. "msc3202_transaction_extensions", False
  51. )
  52. # MSC3706 (server-side support for partial state in /send_join responses)
  53. self.msc3706_enabled: bool = experimental.get("msc3706_enabled", False)
  54. # experimental support for faster joins over federation (msc2775, msc3706)
  55. # requires a target server with msc3706_enabled enabled.
  56. self.faster_joins_enabled: bool = experimental.get("faster_joins", False)
  57. # MSC3720 (Account status endpoint)
  58. self.msc3720_enabled: bool = experimental.get("msc3720_enabled", False)
  59. # The deprecated groups feature.
  60. self.groups_enabled: bool = experimental.get("groups_enabled", True)