summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2018-10-12 11:13:40 +0100
committerRichard van der Hoff <richard@matrix.org>2018-10-25 19:10:24 +0100
commit4cda300058ba68f97c032923ebf429f437eddd8e (patch)
tree3a20d9d320c124c966f459a8ab9fb968bc57d42f /synapse/handlers
parentBasic initial support for room upgrades (diff)
downloadsynapse-4cda300058ba68f97c032923ebf429f437eddd8e.tar.xz
preserve room visibility
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/room.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py
index 3cce6f6150..2f9eb8ef4c 100644
--- a/synapse/handlers/room.py
+++ b/synapse/handlers/room.py
@@ -32,7 +32,7 @@ from synapse.api.constants import (
     JoinRules,
     RoomCreationPreset,
 )
-from synapse.api.errors import AuthError, Codes, StoreError, SynapseError
+from synapse.api.errors import AuthError, Codes, NotFoundError, StoreError, SynapseError
 from synapse.storage.state import StateFilter
 from synapse.types import RoomAlias, RoomID, RoomStreamToken, StreamToken, UserID
 from synapse.util import stringutils
@@ -97,9 +97,11 @@ class RoomCreationHandler(BaseHandler):
 
         with (yield self._upgrade_linearizer.queue(old_room_id)):
             # start by allocating a new room id
-            is_public = False  # XXX fixme
+            r = yield self.store.get_room(old_room_id)
+            if r is None:
+                raise NotFoundError("Unknown room id %s" % (old_room_id,))
             new_room_id = yield self._generate_room_id(
-                creator_id=user_id, is_public=is_public,
+                creator_id=user_id, is_public=r["is_public"],
             )
 
             # we create and auth the tombstone event before properly creating the new