Wait for self presence in MUC and re-try if no one received
Dependencies
- [2]
C6VGR2RWPing other domains to test s2s - [3]
ADKJN3JUTry to reconnect to MUC - [4]
UL67RM6XRe-implement sending message - [5]
TGO4TIWUFix README - [6]
FZBPGF6XDescribe ping - [*]
55VVNPHULog presence errors as errors - [*]
727YJ2SLSend message and presence to MUC
Change contents
- edit in src/xmpp/xmpp_connection.rs at line 249
}}}struct MucWait {/// time of sending iqsent: Instant,/// timeouttimeout: Duration,}impl MucWait {pub fn new(timeout_secs: u64) -> MucWait {MucWait {sent: Instant::now(),timeout: Duration::from_secs(timeout_secs), - edit in src/xmpp/xmpp_connection.rs at line 300
/// map from MUC full jidpending_mucs: HashMap<jid::FullJid, MucWait>, - edit in src/xmpp/xmpp_connection.rs at line 824
self.state.data.pending_mucs.insert(room.clone(), MucWait::new(60)); - edit in src/xmpp/xmpp_connection.rs at line 839
xmpp_parsers::presence::Type::None => {if Self::compare_jid_to_full_jid(&presence.to, &self.account.jid) {if let Some(room) = self.account.chatrooms.values().find(|j| presence.from.as_ref().is_some_and(|ref p| p == j)){info!("Incoming None presence stanza to self from room: {:?}",presence);let payloads: Vec<_> = presence.payloads.into_iter().filter_map(|x| {std::convert::TryInto::<xmpp_parsers::muc::MucUser>::try_into(x).ok()}).collect();info!("Got MUC user payloads: {:?}", payloads);self.state.data.pending_mucs.remove(room);} else {warn!("Incoming None presence stanza to self: {:?}", presence);}} else {warn!("Incoming None presence stanza: {:?}", presence);}} - replacement in src/xmpp/xmpp_connection.rs at line 1123
})});let timeouted: Vec<jid::FullJid> = self.state.data.pending_mucs.iter().filter_map(|(jid, data)| {if now >= data.sent + data.timeout {warn!("MUC Timeout for {} was {:?} expected {:?}",jid,now - data.sent,data.timeout);Some(jid.clone())} else {None}}).collect();timeouted.into_iter().for_each(|jid| {if self.state.data.pending_mucs.remove(&jid).is_some() {self.state.data.counter += 1;let id_muc_presence = format!("id_muc_presence_enter_mucs_error{}",self.state.data.counter);let muc_presence = stanzas::make_muc_presence(&id_muc_presence,self.account.jid.clone(),jid.clone(),None,None,);self.state.data.pending_mucs.insert(jid.clone(), MucWait::new(60));self.state.data.send_queue.push_back(muc_presence);}}); - edit in src/xmpp/xmpp_connection.rs at line 1206[9.1234][9.1234]
self.state.data.pending_mucs.insert(muc.clone(), MucWait::new(60)); - edit in src/xmpp/xmpp_connection.rs at line 1327
self.state.data.pending_mucs.insert(chatroom.1.clone(), MucWait::new(60));