From 0e4c9040914551d2c429e2bd5eedc9df4b4da2d6 Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Mon, 3 Jul 2023 13:36:03 -0700 Subject: [PATCH] Add joined sound effect when new participants join the room --- crates/call/src/call.rs | 10 +++------- crates/call/src/room.rs | 7 ++++++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/crates/call/src/call.rs b/crates/call/src/call.rs index 74ce7c2e75d4e44982cc159963b35367332ba0fc..0a8f150194ed201401218d29d6b1602f5c1a1d82 100644 --- a/crates/call/src/call.rs +++ b/crates/call/src/call.rs @@ -10,19 +10,15 @@ use futures::{future::Shared, FutureExt}; use postage::watch; use gpui::{ - AppContext, AsyncAppContext, Entity, ModelContext, ModelHandle, Subscription, - Task, WeakModelHandle, + AppContext, AsyncAppContext, Entity, ModelContext, ModelHandle, Subscription, Task, + WeakModelHandle, }; use project::Project; pub use participant::ParticipantLocation; pub use room::Room; -pub fn init( - client: Arc, - user_store: ModelHandle, - cx: &mut AppContext, -) { +pub fn init(client: Arc, user_store: ModelHandle, cx: &mut AppContext) { let active_call = cx.add_model(|cx| ActiveCall::new(client, user_store, cx)); cx.set_global(active_call); } diff --git a/crates/call/src/room.rs b/crates/call/src/room.rs index 10cfc862e919a9438d4a7293a4abf4bdee80a068..eed73ba1b1d5f2151a0f93ff10f3e7ac562f17c2 100644 --- a/crates/call/src/room.rs +++ b/crates/call/src/room.rs @@ -663,6 +663,8 @@ impl Room { }, ); + Audio::play_sound(Sound::Joined, cx); + if let Some(live_kit) = this.live_kit.as_ref() { let video_tracks = live_kit.room.remote_video_tracks(&user.id.to_string()); @@ -1363,7 +1365,10 @@ impl LiveKitRoom { let old_muted = *muted; *muted = should_mute; cx.notify(); - Ok((cx.background().spawn(track_publication.set_mute(*muted)), old_muted)) + Ok(( + cx.background().spawn(track_publication.set_mute(*muted)), + old_muted, + )) } }?;