Update to xmpp-rs (ec72d71551) to get serde support for ResourcePart
Signed-off-by: pep <pep@bouah.net>
This commit is contained in:
parent
c29e87be03
commit
9eeca94366
3 changed files with 6 additions and 7 deletions
|
@ -20,7 +20,7 @@ pretty_env_logger = "0.5"
|
|||
serde = { version = "1.0", features = [ "derive" ] }
|
||||
serde_json = "1.0"
|
||||
toml = "0.8"
|
||||
xmpp = { git = "https://gitlab.com/xmpp-rs/xmpp-rs", rev = "5bc94dce95", default-features = false, features = [ "serde", "starttls-native"] }
|
||||
xmpp = { git = "https://gitlab.com/xmpp-rs/xmpp-rs", rev = "ec72d71551", default-features = false, features = [ "serde", "starttls-native"] }
|
||||
hmac = "0.12"
|
||||
sha2 = "0.10"
|
||||
hex = "0.4"
|
||||
|
|
|
@ -33,8 +33,7 @@ pub struct XmppClient {
|
|||
}
|
||||
|
||||
impl XmppClient {
|
||||
pub fn new(jid: BareJid, password: &str, rooms: Vec<BareJid>, nickname: String) -> XmppClient {
|
||||
let nickname: ResourcePart = ResourcePart::new(&nickname).unwrap().into();
|
||||
pub fn new(jid: BareJid, password: &str, rooms: Vec<BareJid>, nickname: ResourcePart) -> XmppClient {
|
||||
let agent = ClientBuilder::new(jid, password)
|
||||
.set_client(ClientType::Bot, "xmpp-rs")
|
||||
.set_website("https://gitlab.com/xmpp-rs/xmpp-rs")
|
||||
|
|
|
@ -19,7 +19,7 @@ use std::net::{IpAddr, Ipv6Addr, SocketAddr};
|
|||
use camino::{Utf8Path, Utf8PathBuf};
|
||||
use log::debug;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use xmpp::jid::BareJid;
|
||||
use xmpp::jid::{BareJid, ResourcePart};
|
||||
|
||||
use crate::error::Error;
|
||||
|
||||
|
@ -37,7 +37,7 @@ pub struct Config {
|
|||
|
||||
/// Nickname to use in rooms
|
||||
#[serde(default = "Config::default_nickname")]
|
||||
pub nickname: String,
|
||||
pub nickname: ResourcePart,
|
||||
|
||||
/// Secret that matches the one provided to the Webhook service
|
||||
#[serde(rename = "secret")]
|
||||
|
@ -49,8 +49,8 @@ pub struct Config {
|
|||
}
|
||||
|
||||
impl Config {
|
||||
pub fn default_nickname() -> String {
|
||||
String::from("cusku")
|
||||
pub fn default_nickname() -> ResourcePart {
|
||||
ResourcePart::new("cusku").unwrap().into()
|
||||
}
|
||||
|
||||
pub fn default_addr() -> SocketAddr {
|
||||
|
|
Loading…
Reference in a new issue