Revert "config: custom deserializer for nickname"
This is now fixed in xmpp-rs upstream in 6624dffe.
This reverts commit 72a3e5a188.
This commit is contained in:
parent
628595af4d
commit
c3eee99d2a
1 changed files with 1 additions and 12 deletions
|
|
@ -18,7 +18,7 @@ use std::net::{IpAddr, Ipv6Addr, SocketAddr};
|
||||||
|
|
||||||
use camino::{Utf8Path, Utf8PathBuf};
|
use camino::{Utf8Path, Utf8PathBuf};
|
||||||
use log::debug;
|
use log::debug;
|
||||||
use serde::{Deserialize, Deserializer, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use xmpp::jid::{BareJid, ResourcePart};
|
use xmpp::jid::{BareJid, ResourcePart};
|
||||||
|
|
||||||
use crate::error::Error;
|
use crate::error::Error;
|
||||||
|
|
@ -41,7 +41,6 @@ pub struct Config {
|
||||||
|
|
||||||
/// Nickname to use in rooms
|
/// Nickname to use in rooms
|
||||||
#[serde(default = "Config::default_nickname")]
|
#[serde(default = "Config::default_nickname")]
|
||||||
#[serde(deserialize_with = "Config::owned_nickname")]
|
|
||||||
pub nickname: ResourcePart,
|
pub nickname: ResourcePart,
|
||||||
|
|
||||||
/// Secret that matches the one provided to the Webhook service
|
/// Secret that matches the one provided to the Webhook service
|
||||||
|
|
@ -58,16 +57,6 @@ impl Config {
|
||||||
ResourcePart::new("cusku").unwrap().into()
|
ResourcePart::new("cusku").unwrap().into()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn owned_nickname<'de, D>(deserializer: D) -> Result<ResourcePart, D::Error>
|
|
||||||
where
|
|
||||||
D: Deserializer<'de>,
|
|
||||||
{
|
|
||||||
let s = String::deserialize(deserializer)?;
|
|
||||||
Ok(ResourcePart::new(&s)
|
|
||||||
.map_err(serde::de::Error::custom)?
|
|
||||||
.into_owned())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn default_addr() -> SocketAddr {
|
pub fn default_addr() -> SocketAddr {
|
||||||
SocketAddr::new(IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1)), 3000)
|
SocketAddr::new(IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1)), 3000)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue