diff options
author | 2025-03-27 19:09:35 +0000 | |
---|---|---|
committer | 2025-03-27 19:09:35 +0000 | |
commit | a367aca33fecc03270b5b9ad2a6a21281d760fd8 (patch) | |
tree | 695270823ee5d55f483875580c509fb2c300bd26 /filamento/src/logic/process_stanza.rs | |
parent | 83a6aa0574190137b38331bd53795324139237cf (diff) | |
download | luz-a367aca33fecc03270b5b9ad2a6a21281d760fd8.tar.gz luz-a367aca33fecc03270b5b9ad2a6a21281d760fd8.tar.bz2 luz-a367aca33fecc03270b5b9ad2a6a21281d760fd8.zip |
refactor(filamento): handle_online logic
Diffstat (limited to '')
-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 |