From 552848b3edc3704a2f914047a6430d5eb82628f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Wed, 7 Jun 2023 19:10:45 +0200 Subject: [PATCH] xmpp: Revert part of 9c39e3 and fix code at the right place MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- xmpp/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xmpp/src/lib.rs b/xmpp/src/lib.rs index 2a28b08..02f2da7 100644 --- a/xmpp/src/lib.rs +++ b/xmpp/src/lib.rs @@ -288,7 +288,7 @@ impl Agent { .clone() .unwrap_or_else(|| self.client.bound_jid().unwrap().clone()); 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); match query { Ok(query) => { @@ -381,7 +381,7 @@ impl Agent { let mut found_special_message = false; 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() { Jid::Bare(bare) => { // TODO: Can a service message be of type Chat/Normal and not Groupchat?