Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
New client creation event will always have room version set
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed Jan 21, 2019
1 parent d10e3b9 commit 3a396c7
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions synapse/handlers/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from twisted.internet import defer
from twisted.internet.defer import succeed

from synapse.api.constants import MAX_DEPTH, EventTypes, Membership, RoomVersions
from synapse.api.constants import MAX_DEPTH, EventTypes, Membership
from synapse.api.errors import (
AuthError,
Codes,
Expand Down Expand Up @@ -279,12 +279,7 @@ def create_event(self, requester, event_dict, token_id=None, txn_id=None,
yield self.auth.check_auth_blocking(requester.user.to_string())

if event_dict["type"] == EventTypes.Create and event_dict["state_key"] == "":
# Set default room_version here
content = event_dict.setdefault("content", {})
room_version = content.get("room_version")
if not room_version:
room_version = RoomVersions.V1
content["room_version"] = room_version
room_version = event_dict["content"]["room_version"]
else:
try:
room_version = yield self.store.get_room_version(event_dict["room_id"])
Expand Down

0 comments on commit 3a396c7

Please sign in to comment.