diff --git a/Cargo.toml b/Cargo.toml index 456edba..e5a0811 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ pretty_env_logger = "0.5" serde = { version = "1.0", features = [ "derive" ] } serde_json = "1.0" toml = "0.9" -xmpp = { git = "https://gitlab.com/xmpp-rs/xmpp-rs", rev = "239a0191", default-features = false, features = [ "serde", "starttls", "rustls-native-certs", "aws_lc_rs" ] } +xmpp = { git = "https://gitlab.com/xmpp-rs/xmpp-rs", branch = "xmpp-config", default-features = false, features = [ "serde", "starttls", "rustls-native-certs", "aws_lc_rs" ] } hmac = "0.12" sha2 = "0.10" hex = "0.4" diff --git a/Changelog b/Changelog index b488965..5631b24 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,10 @@ +Version NEXT: +0000-00-00 RELEASER + * Changes: + - Prevent xmpp-rs dep from using `autojoin` flag for bookmarks which was + preventing from reusing the same account for multiple instances of the + bot. + Version 0.2.0: 2023-08-23 Maxime “pep” Buquet * Changes: diff --git a/src/bot.rs b/src/bot.rs index 968979e..26d6ed2 100644 --- a/src/bot.rs +++ b/src/bot.rs @@ -22,7 +22,7 @@ use xmpp::jid::{BareJid, Jid, ResourcePart}; use xmpp::parsers::message::MessageType; use xmpp::{ message::send::RawMessageSettings, muc::room::JoinRoomSettings, Agent, ClientBuilder, - ClientFeature, ClientType, Event, RoomNick, + ClientFeature, ClientType, Event, RoomNick, Config as AgentConfig, }; pub struct XmppClient { @@ -39,7 +39,12 @@ impl XmppClient { rooms: Vec, nickname: ResourcePart, ) -> XmppClient { + let config = AgentConfig { + bookmarks_autojoin: false, + ..AgentConfig::default() + }; let agent = ClientBuilder::new(jid, password) + .set_config(config) .set_client(ClientType::Bot, "xmpp-rs") .set_website("https://gitlab.com/xmpp-rs/xmpp-rs") .set_default_nick(&nickname)