api.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Copyright 2015, 2016 OpenMarket Ltd
  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.api.constants import EventTypes
  15. from ._base import Config
  16. class ApiConfig(Config):
  17. def read_config(self, config):
  18. self.room_invite_state_types = config.get("room_invite_state_types", [
  19. EventTypes.JoinRules,
  20. EventTypes.CanonicalAlias,
  21. EventTypes.RoomAvatar,
  22. EventTypes.Name,
  23. ])
  24. def default_config(cls, **kwargs):
  25. return """\
  26. ## API Configuration ##
  27. # A list of event types that will be included in the room_invite_state
  28. room_invite_state_types:
  29. - "{JoinRules}"
  30. - "{CanonicalAlias}"
  31. - "{RoomAvatar}"
  32. - "{Name}"
  33. """.format(**vars(EventTypes))