Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(Teleport): Fix teleport remove event no longer being sent #1320

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ tech changes will usually be stripped from release notes for the public

## Unreleased

### Fixed

- Teleport: shapes would not be removed on the old location until a refresh

## [2023.3.0] - 2023-09-17

### Added
Expand Down
10 changes: 7 additions & 3 deletions server/src/api/socket/shape/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,18 +399,22 @@ async def move_shapes(sid: str, raw_data: Any):
target_layer = floor.layers.where(Layer.name == data.target.layer)[0]

shapes = []
old_floor = None
for shape in _get_shapes_from_uuids(data.shapes, False):
layer = target_layer
if shape.layer:
if old_floor is None:
old_floor = shape.layer.floor
layer = floor.layers.where(Layer.name == shape.layer.name)[0]
elif layer is None:
logger.warn("Attempt to move a shape without layer info")
continue
shapes.append((shape, layer))

await send_remove_shapes(
[sh.uuid for sh, _ in shapes], room=floor.location.get_path()
)
if old_floor:
await send_remove_shapes(
[sh.uuid for sh, _ in shapes], room=old_floor.location.get_path()
)

for shape, layer in shapes:
shape.layer = layer
Expand Down