Merge remote-tracking branch 'origin/main' into screen-sharing

This commit is contained in:
Antonio Scandurra 2022-10-19 09:21:07 +02:00
commit 219793afcc
101 changed files with 2207 additions and 1945 deletions

View file

@ -67,6 +67,7 @@ pub struct Collaborator {
#[derive(Default, Serialize)]
pub struct Worktree {
pub abs_path: PathBuf,
pub root_name: String,
pub visible: bool,
#[serde(skip)]
@ -215,11 +216,16 @@ impl Store {
let connected_user = self.connected_users.get(&user_id).unwrap();
if let Some(active_call) = connected_user.active_call.as_ref() {
let room_id = active_call.room_id;
let left_room = self.leave_room(room_id, connection_id)?;
result.hosted_projects = left_room.unshared_projects;
result.guest_projects = left_room.left_projects;
result.room = Some(Cow::Owned(left_room.room.into_owned()));
result.canceled_call_connection_ids = left_room.canceled_call_connection_ids;
if active_call.connection_id == Some(connection_id) {
let left_room = self.leave_room(room_id, connection_id)?;
result.hosted_projects = left_room.unshared_projects;
result.guest_projects = left_room.left_projects;
result.room = Some(Cow::Owned(left_room.room.into_owned()));
result.canceled_call_connection_ids = left_room.canceled_call_connection_ids;
} else if connected_user.connection_ids.len() == 1 {
let (room, _) = self.decline_call(room_id, connection_id)?;
result.room = Some(Cow::Owned(room.clone()));
}
}
let connected_user = self.connected_users.get_mut(&user_id).unwrap();