use crate::RoomNick;
use core::str::FromStr;
#[derive(Debug, Clone)]
pub enum ClientType {
Bot,
Pc,
}
impl Default for ClientType {
fn default() -> Self {
ClientType::Bot
}
}
impl ToString for ClientType {
fn to_string(&self) -> String {
String::from(match self {
ClientType::Bot => "bot",
ClientType::Pc => "pc",
})
}
}
#[derive(Debug, Clone)]
pub struct Config {
pub bookmarks_autojoin: bool,
pub default_nick: RoomNick,
pub disco: (ClientType, String),
pub lang: Vec<String>,
pub website: String,
}
impl Default for Config {
fn default() -> Self {
Self::new()
}
}
impl Config {
fn new() -> Self {
Config {
bookmarks_autojoin: true,
default_nick: RoomNick::from_str("xmpp-rs").unwrap(),
disco: (ClientType::default(), String::from("tokio-xmpp")),
lang: vec![String::from("en")],
website: String::from("https://gitlab.com/xmpp-rs/tokio-xmpp"),
}
}
}