opt: uniform name

This commit is contained in:
Kingtous 2023-02-06 12:14:20 +08:00
parent a601e3b241
commit 850c4bcbbf
4 changed files with 7 additions and 6 deletions

View File

@ -749,6 +749,7 @@ impl<T: InvokeUiSession> Remote<T> {
.unwrap_or(NonZeroI64::new(get_time()).unwrap()), .unwrap_or(NonZeroI64::new(get_time()).unwrap()),
); );
allow_err!(peer.send(&msg).await); allow_err!(peer.send(&msg).await);
self.handler.on_voice_call_waiting();
} }
Data::CloseVoiceCall => { Data::CloseVoiceCall => {
self.stop_voice_call(); self.stop_voice_call();
@ -1262,7 +1263,7 @@ impl<T: InvokeUiSession> Remote<T> {
self.stop_voice_call_sender = self.start_voice_call(); self.stop_voice_call_sender = self.start_voice_call();
} else { } else {
// The peer refused the voice call. // The peer refused the voice call.
self.handler.on_voice_call_stop("Refused"); self.handler.on_voice_call_closed("Refused");
} }
} }
} }

View File

@ -399,8 +399,8 @@ impl InvokeUiSession for FlutterHandler {
self.push_event("on_voice_call_start", [].into()); self.push_event("on_voice_call_start", [].into());
} }
fn on_voice_call_stop(&self, reason: &str) { fn on_voice_call_closed(&self, reason: &str) {
self.push_event("on_voice_call_stop", [("reason", reason)].into()) self.push_event("on_voice_call_closed", [("reason", reason)].into())
} }
fn on_voice_call_waiting(&self) { fn on_voice_call_waiting(&self) {

View File

@ -271,8 +271,8 @@ impl InvokeUiSession for SciterHandler {
self.call("onVoiceCallStart", &make_args!()); self.call("onVoiceCallStart", &make_args!());
} }
fn on_voice_call_stop(&self, reason: &str) { fn on_voice_call_closed(&self, reason: &str) {
self.call("onVoiceCallStop", &make_args!(reason)); self.call("onVoiceCallClosed", &make_args!(reason));
} }
fn on_voice_call_waiting(&self) { fn on_voice_call_waiting(&self) {

View File

@ -706,7 +706,7 @@ pub trait InvokeUiSession: Send + Sync + Clone + 'static + Sized + Default {
fn cancel_msgbox(&self, tag: &str); fn cancel_msgbox(&self, tag: &str);
fn switch_back(&self, id: &str); fn switch_back(&self, id: &str);
fn on_voice_call_start(&self); fn on_voice_call_start(&self);
fn on_voice_call_stop(&self, reason: &str); fn on_voice_call_closed(&self, reason: &str);
fn on_voice_call_waiting(&self); fn on_voice_call_waiting(&self);
fn on_voice_call_incoming(&self); fn on_voice_call_incoming(&self);
} }