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

Commit

Permalink
preserve room visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
richvdh committed Oct 25, 2018
1 parent 0f7d1c9 commit 4cda300
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions synapse/handlers/room.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
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
Expand Down Expand Up @@ -97,9 +97,11 @@ def upgrade_room(self, requester, old_room_id, new_version):

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
Expand Down
2 changes: 1 addition & 1 deletion synapse/storage/room.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def get_room(self, room_id):
Args:
room_id (str): The ID of the room to retrieve.
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(
table="rooms",
Expand Down

0 comments on commit 4cda300

Please sign in to comment.