preserve room visibility

This commit is contained in:
Richard van der Hoff 2018-10-12 11:13:40 +01:00
parent 0f7d1c9906
commit 4cda300058
2 changed files with 6 additions and 4 deletions

View File

@ -32,7 +32,7 @@ from synapse.api.constants import (
JoinRules, JoinRules,
RoomCreationPreset, 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.storage.state import StateFilter
from synapse.types import RoomAlias, RoomID, RoomStreamToken, StreamToken, UserID from synapse.types import RoomAlias, RoomID, RoomStreamToken, StreamToken, UserID
from synapse.util import stringutils from synapse.util import stringutils
@ -97,9 +97,11 @@ class RoomCreationHandler(BaseHandler):
with (yield self._upgrade_linearizer.queue(old_room_id)): with (yield self._upgrade_linearizer.queue(old_room_id)):
# start by allocating a new 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( 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 # we create and auth the tombstone event before properly creating the new

View File

@ -47,7 +47,7 @@ class RoomWorkerStore(SQLBaseStore):
Args: Args:
room_id (str): The ID of the room to retrieve. room_id (str): The ID of the room to retrieve.
Returns: Returns:
A namedtuple containing the room information, or an empty list. A dict containing the room information, or None if the room is unknown.
""" """
return self._simple_select_one( return self._simple_select_one(
table="rooms", table="rooms",