mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 11:06:07 -04:00
Add config option for setting homeserver's default room version (#5223)
Replaces DEFAULT_ROOM_VERSION constant with a method that first checks the config, then returns a hardcoded value if the option is not present. That hardcoded value is now located in the server.py config file.
This commit is contained in:
parent
b75537beaf
commit
6368150a74
7 changed files with 57 additions and 10 deletions
|
@ -16,7 +16,7 @@ import logging
|
|||
|
||||
from twisted.internet import defer
|
||||
|
||||
from synapse.api.room_versions import DEFAULT_ROOM_VERSION, KNOWN_ROOM_VERSIONS
|
||||
from synapse.api.room_versions import KNOWN_ROOM_VERSIONS
|
||||
from synapse.http.servlet import RestServlet
|
||||
|
||||
from ._base import client_v2_patterns
|
||||
|
@ -36,6 +36,7 @@ class CapabilitiesRestServlet(RestServlet):
|
|||
"""
|
||||
super(CapabilitiesRestServlet, self).__init__()
|
||||
self.hs = hs
|
||||
self.config = hs.config
|
||||
self.auth = hs.get_auth()
|
||||
self.store = hs.get_datastore()
|
||||
|
||||
|
@ -48,7 +49,7 @@ class CapabilitiesRestServlet(RestServlet):
|
|||
response = {
|
||||
"capabilities": {
|
||||
"m.room_versions": {
|
||||
"default": DEFAULT_ROOM_VERSION.identifier,
|
||||
"default": self.config.default_room_version.identifier,
|
||||
"available": {
|
||||
v.identifier: v.disposition
|
||||
for v in KNOWN_ROOM_VERSIONS.values()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue