aboutsummaryrefslogtreecommitdiffstats
path: root/filamento/src/logic/process_stanza.rs
diff options
context:
space:
mode:
authorLibravatar cel 🌸 <cel@bunny.garden>2025-03-27 19:09:35 +0000
committerLibravatar cel 🌸 <cel@bunny.garden>2025-03-27 19:09:35 +0000
commita367aca33fecc03270b5b9ad2a6a21281d760fd8 (patch)
tree695270823ee5d55f483875580c509fb2c300bd26 /filamento/src/logic/process_stanza.rs
parent83a6aa0574190137b38331bd53795324139237cf (diff)
downloadluz-a367aca33fecc03270b5b9ad2a6a21281d760fd8.tar.gz
luz-a367aca33fecc03270b5b9ad2a6a21281d760fd8.tar.bz2
luz-a367aca33fecc03270b5b9ad2a6a21281d760fd8.zip
refactor(filamento): handle_online logic
Diffstat (limited to 'filamento/src/logic/process_stanza.rs')
-rw-r--r--filamento/src/logic/process_stanza.rs15
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