Skip to content

Commit

Permalink
revert single channel click (#7738)
Browse files Browse the repository at this point in the history
- Revert "collab tweaks (#7706)"
- Revert "2112 (#7640)"
- Revert "single click channel (#7596)"
- Reserve protobufs
- Don't revert migrations

Release Notes:

- N/A

**or**

- N/A
  • Loading branch information
ConradIrwin authored Feb 13, 2024
1 parent ecd9b93 commit 2294d99
Show file tree
Hide file tree
Showing 26 changed files with 522 additions and 706 deletions.
6 changes: 4 additions & 2 deletions assets/settings/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@
"show_whitespaces": "selection",
// Settings related to calls in Zed
"calls": {
// Join calls with the microphone muted by default
"mute_on_join": false
// Join calls with the microphone live by default
"mute_on_join": false,
// Share your project when you are the first to join a channel
"share_on_join": true
},
// Toolbar related settings
"toolbar": {
Expand Down
21 changes: 3 additions & 18 deletions crates/call/src/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ pub struct ActiveCall {
),
client: Arc<Client>,
user_store: Model<UserStore>,
pending_channel_id: Option<u64>,
_subscriptions: Vec<client::Subscription>,
}

Expand All @@ -98,7 +97,6 @@ impl ActiveCall {
location: None,
pending_invites: Default::default(),
incoming_call: watch::channel(),
pending_channel_id: None,
_join_debouncer: OneAtATime { cancel: None },
_subscriptions: vec![
client.add_request_handler(cx.weak_model(), Self::handle_incoming_call),
Expand All @@ -113,10 +111,6 @@ impl ActiveCall {
self.room()?.read(cx).channel_id()
}

pub fn pending_channel_id(&self) -> Option<u64> {
self.pending_channel_id
}

async fn handle_incoming_call(
this: Model<Self>,
envelope: TypedEnvelope<proto::IncomingCall>,
Expand Down Expand Up @@ -345,13 +339,11 @@ impl ActiveCall {
channel_id: u64,
cx: &mut ModelContext<Self>,
) -> Task<Result<Option<Model<Room>>>> {
let mut leave = None;
if let Some(room) = self.room().cloned() {
if room.read(cx).channel_id() == Some(channel_id) {
return Task::ready(Ok(Some(room)));
} else {
let (room, _) = self.room.take().unwrap();
leave = room.update(cx, |room, cx| Some(room.leave(cx)));
room.update(cx, |room, cx| room.clear_state(cx));
}
}

Expand All @@ -361,21 +353,14 @@ impl ActiveCall {

let client = self.client.clone();
let user_store = self.user_store.clone();
self.pending_channel_id = Some(channel_id);
let join = self._join_debouncer.spawn(cx, move |cx| async move {
if let Some(task) = leave {
task.await?
}
Room::join_channel(channel_id, client, user_store, cx).await
});

cx.spawn(|this, mut cx| async move {
let room = join.await?;
this.update(&mut cx, |this, cx| {
this.pending_channel_id.take();
this.set_room(room.clone(), cx)
})?
.await?;
this.update(&mut cx, |this, cx| this.set_room(room.clone(), cx))?
.await?;
this.update(&mut cx, |this, cx| {
this.report_call_event("join channel", cx)
})?;
Expand Down
6 changes: 6 additions & 0 deletions crates/call/src/call_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use settings::Settings;
#[derive(Deserialize, Debug)]
pub struct CallSettings {
pub mute_on_join: bool,
pub share_on_join: bool,
}

/// Configuration of voice calls in Zed.
Expand All @@ -16,6 +17,11 @@ pub struct CallSettingsContent {
///
/// Default: false
pub mute_on_join: Option<bool>,

/// Whether your current project should be shared when joining an empty channel.
///
/// Default: true
pub share_on_join: Option<bool>,
}

impl Settings for CallSettings {
Expand Down
1 change: 0 additions & 1 deletion crates/call/src/participant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ pub struct RemoteParticipant {
pub participant_index: ParticipantIndex,
pub muted: bool,
pub speaking: bool,
pub in_call: bool,
pub video_tracks: HashMap<live_kit_client::Sid, Arc<RemoteVideoTrack>>,
pub audio_tracks: HashMap<live_kit_client::Sid, Arc<RemoteAudioTrack>>,
}
Loading

0 comments on commit 2294d99

Please sign in to comment.