Introduce the ability of declining calls

This commit is contained in:
Antonio Scandurra 2022-09-26 11:56:19 +02:00
parent f4697ff4d1
commit bb9ce86a29
6 changed files with 181 additions and 29 deletions

View file

@ -245,6 +245,17 @@ impl UserStore {
self.incoming_call.1.clone()
}
pub fn decline_call(&mut self) -> Result<()> {
let mut incoming_call = self.incoming_call.0.borrow_mut();
if incoming_call.is_some() {
if let Some(client) = self.client.upgrade() {
client.send(proto::DeclineCall {})?;
}
*incoming_call = None;
}
Ok(())
}
async fn handle_update_contacts(
this: ModelHandle<Self>,
message: TypedEnvelope<proto::UpdateContacts>,