Update to xmpp 0.6

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
xmppftw 2024-08-07 10:47:12 +02:00 committed by Maxime “pep” Buquet
parent ac67c52bee
commit 7b63e24168
Signed by: pep
GPG key ID: DEDA74AEECA9D0F2
3 changed files with 9 additions and 7 deletions

View file

@ -14,14 +14,14 @@ hyper = { version = "1.4", default-features = false, features = [ "http1", "serv
hyper-util = { version = "0.1", features = [ "tokio" ] } hyper-util = { version = "0.1", features = [ "tokio" ] }
http-body-util = "0.1" http-body-util = "0.1"
bytes = "1.6" bytes = "1.6"
jid = { version = "0.10", features = [ "serde" ] }
log = "0.4" log = "0.4"
tokio = { version = "1", default-features = false, features = [ "rt", "net", "sync", "fs" ] } tokio = { version = "1", default-features = false, features = [ "rt", "net", "sync", "fs" ] }
tokio-xmpp = { version = "4.0.0", default-features = false }
pretty_env_logger = "0.5" pretty_env_logger = "0.5"
serde = { version = "1.0", features = [ "derive" ] } serde = { version = "1.0", features = [ "derive" ] }
serde_json = "1.0" serde_json = "1.0"
toml = "0.8" toml = "0.8"
xmpp = "0.5" xmpp = { version = "0.6", default-features = false, features = [ "serde", "starttls-native"] }
hmac = "0.12" hmac = "0.12"
sha2 = "0.10" sha2 = "0.10"
hex = "0.4" hex = "0.4"

View file

@ -16,12 +16,14 @@
use crate::hook::{format_hook, GitlabHook}; use crate::hook::{format_hook, GitlabHook};
use log::debug; use log::debug;
use tokio_xmpp::starttls::ServerConfig;
use xmpp::jid::{BareJid, Jid};
use xmpp::parsers::message::MessageType; use xmpp::parsers::message::MessageType;
use xmpp::{Agent, BareJid, ClientBuilder, ClientFeature, ClientType, Event, Jid}; use xmpp::{Agent, ClientBuilder, ClientFeature, ClientType, Event};
pub struct XmppClient { pub struct XmppClient {
is_online: bool, is_online: bool,
agent: Agent, agent: Agent<ServerConfig>,
rooms: Vec<BareJid>, rooms: Vec<BareJid>,
nickname: String, nickname: String,
} }
@ -63,9 +65,9 @@ impl XmppClient {
.await .await
} }
} }
Event::Disconnected => { Event::Disconnected(e) => {
self.is_online = false; self.is_online = false;
debug!("XMPP Disconnected"); debug!("XMPP Disconnected: {e}");
} }
_ => { _ => {
debug!("XMPP Event not supported") debug!("XMPP Event not supported")

View file

@ -17,9 +17,9 @@ use std::io::{Error as IoError, ErrorKind as IoErrorKind};
use std::net::{IpAddr, Ipv6Addr, SocketAddr}; use std::net::{IpAddr, Ipv6Addr, SocketAddr};
use camino::{Utf8Path, Utf8PathBuf}; use camino::{Utf8Path, Utf8PathBuf};
use jid::BareJid;
use log::debug; use log::debug;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use xmpp::jid::BareJid;
use crate::error::Error; use crate::error::Error;