fix: compile
This commit is contained in:
parent
11c6008811
commit
a601e3b241
@ -1288,6 +1288,7 @@ pub fn main_start_ipc_url_server() {
|
|||||||
/// Send a url scheme throught the ipc.
|
/// Send a url scheme throught the ipc.
|
||||||
///
|
///
|
||||||
/// * macOS only
|
/// * macOS only
|
||||||
|
#[allow(unused_variables)]
|
||||||
pub fn send_url_scheme(url: String) {
|
pub fn send_url_scheme(url: String) {
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
thread::spawn(move || crate::ui::macos::handle_url_scheme(url));
|
thread::spawn(move || crate::ui::macos::handle_url_scheme(url));
|
||||||
|
@ -398,9 +398,7 @@ impl Connection {
|
|||||||
conn.send(msg).await;
|
conn.send(msg).await;
|
||||||
}
|
}
|
||||||
ipc::Data::VoiceCallResponse(accepted) => {
|
ipc::Data::VoiceCallResponse(accepted) => {
|
||||||
if accepted {
|
conn.handle_voice_call(accepted).await;
|
||||||
conn.start_voice_call().await;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
ipc::Data::CloseVoiceCall(_reason) => {
|
ipc::Data::CloseVoiceCall(_reason) => {
|
||||||
conn.close_voice_call().await;
|
conn.close_voice_call().await;
|
||||||
@ -1613,17 +1611,19 @@ impl Connection {
|
|||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn start_voice_call(&mut self) {
|
pub async fn handle_voice_call(&mut self, accepted: bool) {
|
||||||
if let Some(ts) = self.voice_call_request_timestamp.take() {
|
if let Some(ts) = self.voice_call_request_timestamp.take() {
|
||||||
let msg = new_voice_call_response(ts.get(), accepted);
|
let msg = new_voice_call_response(ts.get(), accepted);
|
||||||
conn.send(msg).await;
|
self.send(msg).await;
|
||||||
// Backup the default input device.
|
if accepted {
|
||||||
let audio_input_device = Config::get_option("audio-input");
|
// Backup the default input device.
|
||||||
self.audio_input_device_before_voice_call = Some(audio_input_device);
|
let audio_input_device = Config::get_option("audio-input");
|
||||||
// Switch to default input device
|
self.audio_input_device_before_voice_call = Some(audio_input_device);
|
||||||
let default_sound_device = get_default_sound_input();
|
// Switch to default input device
|
||||||
if let Some(device) = default_sound_device {
|
let default_sound_device = get_default_sound_input();
|
||||||
set_sound_input(device);
|
if let Some(device) = default_sound_device {
|
||||||
|
set_sound_input(device);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log::warn!("Possible a voice call attack.");
|
log::warn!("Possible a voice call attack.");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user