xmpp: Revert part of 9c39e3 and fix code at the right place

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2023-06-07 19:10:45 +02:00
parent d52ace59a9
commit 552848b3ed
Signed by: pep
GPG key ID: DEDA74AEECA9D0F2

View file

@ -288,7 +288,7 @@ impl Agent {
.clone() .clone()
.unwrap_or_else(|| self.client.bound_jid().unwrap().clone()); .unwrap_or_else(|| self.client.bound_jid().unwrap().clone());
if let IqType::Get(payload) = iq.payload { if let IqType::Get(payload) = iq.payload {
if MucUser::try_from(payload.clone()).is_ok() { if payload.is("query", ns::DISCO_INFO) {
let query = DiscoInfoQuery::try_from(payload); let query = DiscoInfoQuery::try_from(payload);
match query { match query {
Ok(query) => { Ok(query) => {
@ -381,7 +381,7 @@ impl Agent {
let mut found_special_message = false; let mut found_special_message = false;
for payload in &message.payloads { for payload in &message.payloads {
if payload.is("x", xmpp_parsers::ns::MUC_USER) { if let Ok(_) = MucUser::try_from(payload.clone()) {
let event = match from.clone() { let event = match from.clone() {
Jid::Bare(bare) => { Jid::Bare(bare) => {
// TODO: Can a service message be of type Chat/Normal and not Groupchat? // TODO: Can a service message be of type Chat/Normal and not Groupchat?