diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2018-12-24 10:48:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-24 10:48:59 +0100 |
commit | cd018e3543649b180118e934b80c47310183400e (patch) | |
tree | 0b9acff59fac00042c0982eecc6fda363627cd69 | |
parent | Return well_known in /login response (#4319) (diff) | |
parent | Newsfile (diff) | |
download | synapse-cd018e3543649b180118e934b80c47310183400e.tar.xz |
Merge pull request #4307 from matrix-org/erikj/v2_rooms
Add v2 room version
-rw-r--r-- | changelog.d/4307.feature | 1 | ||||
-rw-r--r-- | synapse/api/constants.py | 2 | ||||
-rw-r--r-- | synapse/state/__init__.py | 4 |
3 files changed, 6 insertions, 1 deletions
diff --git a/changelog.d/4307.feature b/changelog.d/4307.feature new file mode 100644 index 0000000000..314fc031f0 --- /dev/null +++ b/changelog.d/4307.feature @@ -0,0 +1 @@ +Add opt-in support for v2 rooms diff --git a/synapse/api/constants.py b/synapse/api/constants.py index b7f25a42a2..87bc1cb53d 100644 --- a/synapse/api/constants.py +++ b/synapse/api/constants.py @@ -102,6 +102,7 @@ class ThirdPartyEntityKind(object): class RoomVersions(object): V1 = "1" + V2 = "2" VDH_TEST = "vdh-test-version" STATE_V2_TEST = "state-v2-test" @@ -113,6 +114,7 @@ DEFAULT_ROOM_VERSION = RoomVersions.V1 # until we have a working v2. KNOWN_ROOM_VERSIONS = { RoomVersions.V1, + RoomVersions.V2, RoomVersions.VDH_TEST, RoomVersions.STATE_V2_TEST, } diff --git a/synapse/state/__init__.py b/synapse/state/__init__.py index 70048b0c09..e9ecb00277 100644 --- a/synapse/state/__init__.py +++ b/synapse/state/__init__.py @@ -607,7 +607,9 @@ def resolve_events_with_store(room_version, state_sets, event_map, state_res_sto return v1.resolve_events_with_store( state_sets, event_map, state_res_store.get_events, ) - elif room_version in (RoomVersions.VDH_TEST, RoomVersions.STATE_V2_TEST): + elif room_version in ( + RoomVersions.VDH_TEST, RoomVersions.STATE_V2_TEST, RoomVersions.V2, + ): return v2.resolve_events_with_store( state_sets, event_map, state_res_store, ) |