Update deps

This commit is contained in:
Travis Burtrum 2023-12-28 21:35:23 -05:00
parent 76c9d7584f
commit 9c8f21a095
Signed by: moparisthebest
GPG Key ID: 88C93BFE27BC8229
3 changed files with 636 additions and 475 deletions

1093
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -21,17 +21,17 @@ include = [
[dependencies]
futures = "0.3"
toml = "0.5"
toml = "0.8"
serde_derive = "1.0"
serde = { version = "1.0", features = ["derive"] }
dirs = "4.0.0"
dirs = "5.0.1"
minidom = "0.15"
tokio-xmpp = { version = "3.2.0", default-features = false, features = ["tls-rust"] }
tokio-xmpp = { version = "3.5.0", default-features = false, features = ["tls-rust"] }
tokio = { version = "1", features = ["net", "rt", "rt-multi-thread", "macros", "io-util", "io-std"] }
xmpp-parsers = "0.19"
xmpp-parsers = "0.20"
die = "0.2.0"
anyhow = "1.0"
env_logger = "0.9"
env_logger = "0.10"
rand = "0.8.5"
async-recursion = "1.0.5"

View File

@ -37,7 +37,7 @@ impl Context {
fn new(bare_me: BareJid, contact: Jid) -> Context {
Self {
bare_me,
bare_contact: BareJid::from(contact.clone()),
bare_contact: contact.to_bare(),
is_muc: matches!(contact, Jid::Full(_)),
contact,
}
@ -80,7 +80,7 @@ async fn main() -> Result<()> {
let reader = BufReader::new(stdin);
let mut lines = reader.lines();
let mut client = Client::new(&cfg.jid, &cfg.password)?;
let mut client = Client::new(context.bare_me.clone(), &cfg.password);
client.set_reconnect(true);
loop {
@ -125,12 +125,12 @@ async fn handle_xmpp_element(element: Element, context: &Context) -> Result<()>
// eprintln!("+ whole message: {message:?}");
match (message.from, message.bodies.get("")) {
(Some(from), Some(body)) => {
let bare_from = BareJid::from(from.clone());
let bare_from = from.to_bare();
if bare_from == context.bare_contact || bare_from == context.bare_me {
let from = match from {
Jid::Full(jid) => {
if context.is_muc {
jid.resource
jid.resource_str().to_string()
} else {
bare_from.to_string()
}