mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-12-18 05:34:21 -05:00
Correctly use default room version if none is set
This commit is contained in:
parent
f01c7488ab
commit
d758d5310e
@ -22,7 +22,7 @@ from canonicaljson import encode_canonical_json, json
|
|||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
from twisted.internet.defer import succeed
|
from twisted.internet.defer import succeed
|
||||||
|
|
||||||
from synapse.api.constants import MAX_DEPTH, EventTypes, Membership
|
from synapse.api.constants import MAX_DEPTH, EventTypes, Membership, RoomVersions
|
||||||
from synapse.api.errors import (
|
from synapse.api.errors import (
|
||||||
AuthError,
|
AuthError,
|
||||||
Codes,
|
Codes,
|
||||||
@ -612,7 +612,7 @@ class EventCreationHandler(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
if event.is_state() and (event.type, event.state_key) == (EventTypes.Create, ""):
|
if event.is_state() and (event.type, event.state_key) == (EventTypes.Create, ""):
|
||||||
room_version = event.content["room_version"]
|
room_version = event.content.get("room_version", RoomVersions.V1)
|
||||||
else:
|
else:
|
||||||
room_version = yield self.store.get_room_version(event.room_id)
|
room_version = yield self.store.get_room_version(event.room_id)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user