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 = { version = "1.0", features = [ "derive" ] }
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
toml = "0.8"
|
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"
|
hmac = "0.12"
|
||||||
sha2 = "0.10"
|
sha2 = "0.10"
|
||||||
hex = "0.4"
|
hex = "0.4"
|
||||||
|
|
|
@ -33,8 +33,7 @@ pub struct XmppClient {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl XmppClient {
|
impl XmppClient {
|
||||||
pub fn new(jid: BareJid, password: &str, rooms: Vec<BareJid>, nickname: String) -> XmppClient {
|
pub fn new(jid: BareJid, password: &str, rooms: Vec<BareJid>, nickname: ResourcePart) -> XmppClient {
|
||||||
let nickname: ResourcePart = ResourcePart::new(&nickname).unwrap().into();
|
|
||||||
let agent = ClientBuilder::new(jid, password)
|
let agent = ClientBuilder::new(jid, password)
|
||||||
.set_client(ClientType::Bot, "xmpp-rs")
|
.set_client(ClientType::Bot, "xmpp-rs")
|
||||||
.set_website("https://gitlab.com/xmpp-rs/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 camino::{Utf8Path, Utf8PathBuf};
|
||||||
use log::debug;
|
use log::debug;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use xmpp::jid::BareJid;
|
use xmpp::jid::{BareJid, ResourcePart};
|
||||||
|
|
||||||
use crate::error::Error;
|
use crate::error::Error;
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ pub struct Config {
|
||||||
|
|
||||||
/// Nickname to use in rooms
|
/// Nickname to use in rooms
|
||||||
#[serde(default = "Config::default_nickname")]
|
#[serde(default = "Config::default_nickname")]
|
||||||
pub nickname: String,
|
pub nickname: ResourcePart,
|
||||||
|
|
||||||
/// Secret that matches the one provided to the Webhook service
|
/// Secret that matches the one provided to the Webhook service
|
||||||
#[serde(rename = "secret")]
|
#[serde(rename = "secret")]
|
||||||
|
@ -49,8 +49,8 @@ pub struct Config {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Config {
|
impl Config {
|
||||||
pub fn default_nickname() -> String {
|
pub fn default_nickname() -> ResourcePart {
|
||||||
String::from("cusku")
|
ResourcePart::new("cusku").unwrap().into()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn default_addr() -> SocketAddr {
|
pub fn default_addr() -> SocketAddr {
|
||||||
|
|
Loading…
Reference in a new issue