Prototype cursor sharing (the inefficient way) (#3970)
Release Notes: - Sync guest users' cursor positions
This commit is contained in:
commit
3c2ebc3d88
2 changed files with 19 additions and 4 deletions
|
@ -1859,11 +1859,24 @@ async fn update_buffer(
|
|||
let mut guest_connection_ids;
|
||||
let mut host_connection_id = None;
|
||||
|
||||
let mut requires_write_permission = false;
|
||||
|
||||
for op in request.operations.iter() {
|
||||
match op.variant {
|
||||
None | Some(proto::operation::Variant::UpdateSelections(_)) => {}
|
||||
Some(_) => requires_write_permission = true,
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
let collaborators = session
|
||||
.db()
|
||||
.await
|
||||
.project_collaborators_for_buffer_update(project_id, session.connection_id)
|
||||
.project_collaborators_for_buffer_update(
|
||||
project_id,
|
||||
session.connection_id,
|
||||
requires_write_permission,
|
||||
)
|
||||
.await?;
|
||||
guest_connection_ids = Vec::with_capacity(collaborators.len() - 1);
|
||||
for collaborator in collaborators.iter() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue