Show cursors for remote participants (#4082)

This PR enables cursors for remote participants.

They are shown for 2 seconds when you focus a buffer, and then on hover.

Release Notes:

- Added usernames next to remote cursors
This commit is contained in:
Conrad Irwin 2024-01-18 20:58:09 -07:00 committed by GitHub
commit d76bd100f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 209 additions and 7 deletions

View file

@ -450,8 +450,21 @@ impl Database {
)> {
self.transaction(move |tx| async move {
let channel = self.get_channel_internal(channel_id, &*tx).await?;
self.check_user_is_channel_member(&channel, user, &*tx)
.await?;
let mut requires_write_permission = false;
for op in operations.iter() {
match op.variant {
None | Some(proto::operation::Variant::UpdateSelections(_)) => {}
Some(_) => requires_write_permission = true,
}
}
if requires_write_permission {
self.check_user_is_channel_member(&channel, user, &*tx)
.await?;
} else {
self.check_user_is_channel_participant(&channel, user, &*tx)
.await?;
}
let buffer = buffer::Entity::find()
.filter(buffer::Column::ChannelId.eq(channel_id))