xmpp_parsers::presence::Type::Unavailable => {
if presence.to.as_ref() == Some(&self.account.jid) {
if let Some(room) = self
.account
.chatrooms
.values()
.find(|&j| Some(j) == presence.from.as_ref())
{
warn!(
"Got disconnected from MUC {}. Try again: {:?}",
room, presence
);
self.state.data.counter += 1;
let id_muc_presence =
format!("id_muc_presence{}", self.state.data.counter);
let muc_presence = stanzas::make_muc_presence(
&id_muc_presence,
self.account.jid.clone(),
room.clone(),
None,
None,
);
self.state.data.send_queue.push_back(muc_presence);
} else {
warn!(
"Incoming Unavailable presence stanza to self: {:?}",
presence
);
}
} else {
warn!("Incoming Unavailable presence stanza: {:?}", presence);
}
}