fix: close notify

This commit is contained in:
Kingtous 2023-02-07 16:53:46 +08:00
parent fc933ad7b4
commit cd6cdbff8f
2 changed files with 4 additions and 2 deletions

View File

@ -1264,7 +1264,7 @@ impl<T: InvokeUiSession> Remote<T> {
self.stop_voice_call_sender = self.start_voice_call();
} else {
// The peer refused the voice call.
self.handler.on_voice_call_closed("Refused");
self.handler.on_voice_call_closed("");
}
}
}

View File

@ -1614,7 +1614,6 @@ impl Connection {
pub async fn handle_voice_call(&mut self, accepted: bool) {
if let Some(ts) = self.voice_call_request_timestamp.take() {
let msg = new_voice_call_response(ts.get(), accepted);
self.send(msg).await;
if accepted {
// Backup the default input device.
let audio_input_device = Config::get_option("audio-input");
@ -1625,7 +1624,10 @@ impl Connection {
set_sound_input(device);
}
self.send_to_cm(Data::StartVoiceCall);
} else {
self.send_to_cm(Data::CloseVoiceCall("".to_owned()));
}
self.send(msg).await;
} else {
log::warn!("Possible a voice call attack.");
}