diff options
Diffstat (limited to 'filamento/src/logic/process_stanza.rs')
-rw-r--r-- | filamento/src/logic/process_stanza.rs | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/filamento/src/logic/process_stanza.rs b/filamento/src/logic/process_stanza.rs index 94257aa..660da16 100644 --- a/filamento/src/logic/process_stanza.rs +++ b/filamento/src/logic/process_stanza.rs @@ -169,21 +169,14 @@ pub async fn recv_iq( } match iq.r#type { stanza::client::iq::IqType::Error | stanza::client::iq::IqType::Result => { - let send; - { - send = logic.pending().lock().await.remove(&iq.id); - } let from = iq .from .clone() .unwrap_or_else(|| connection.server().clone()); - if let Some(send) = send { - debug!("received iq result from {}", from); - let _ = send.send(Ok(Stanza::Iq(iq))); - Ok(None) - } else { - Err(IqError::NoMatchingId(iq.id)) - } + let id = iq.id.clone(); + debug!("received iq result with id `{}` from {}", id, from); + logic.pending().respond(Stanza::Iq(iq), id).await?; + Ok(None) } stanza::client::iq::IqType::Get => { let from = iq |