fix: rust conn build
This commit is contained in:
parent
b412a7122b
commit
11c6008811
@ -398,8 +398,10 @@ impl Connection {
|
|||||||
conn.send(msg).await;
|
conn.send(msg).await;
|
||||||
}
|
}
|
||||||
ipc::Data::VoiceCallResponse(accepted) => {
|
ipc::Data::VoiceCallResponse(accepted) => {
|
||||||
|
if accepted {
|
||||||
conn.start_voice_call().await;
|
conn.start_voice_call().await;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ipc::Data::CloseVoiceCall(_reason) => {
|
ipc::Data::CloseVoiceCall(_reason) => {
|
||||||
conn.close_voice_call().await;
|
conn.close_voice_call().await;
|
||||||
}
|
}
|
||||||
@ -1611,20 +1613,18 @@ impl Connection {
|
|||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn start_voice_call(&self) {
|
pub async fn start_voice_call(&mut self) {
|
||||||
if let Some(ts) = conn.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;
|
conn.send(msg).await;
|
||||||
if accepted {
|
|
||||||
// Backup the default input device.
|
// Backup the default input device.
|
||||||
let audio_input_device = Config::get_option("audio-input");
|
let audio_input_device = Config::get_option("audio-input");
|
||||||
conn.audio_input_device_before_voice_call = Some(audio_input_device);
|
self.audio_input_device_before_voice_call = Some(audio_input_device);
|
||||||
// Switch to default input device
|
// Switch to default input device
|
||||||
let default_sound_device = get_default_sound_input();
|
let default_sound_device = get_default_sound_input();
|
||||||
if let Some(device) = default_sound_device {
|
if let Some(device) = default_sound_device {
|
||||||
set_sound_input(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