experimental.py 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. # Whether to enable experimental MSC1849 (aka relations) support
  22. self.msc1849_enabled = config.get("experimental_msc1849_support_enabled", True)
  23. # MSC3440 (thread relation)
  24. self.msc3440_enabled: bool = experimental.get("msc3440_enabled", False)
  25. # MSC3026 (busy presence state)
  26. self.msc3026_enabled: bool = experimental.get("msc3026_enabled", False)
  27. # MSC2716 (backfill existing history)
  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. # MSC3283 (set displayname, avatar_url and change 3pid capabilities)
  34. self.msc3283_enabled: bool = experimental.get("msc3283_enabled", False)
  35. # MSC3266 (room summary api)
  36. self.msc3266_enabled: bool = experimental.get("msc3266_enabled", False)