From 88f3ffb316d6eb03518f5c5f192a8b6a7fb73e97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20F=C3=A9ron?= Date: Tue, 22 Oct 2024 23:08:22 +0200 Subject: [PATCH] Set DataMessage expiration_timer to None if set to 0 in Contact --- Cargo.toml | 4 ++-- presage-cli/src/main.rs | 2 +- presage/src/manager/registered.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9beea6058..54db4440c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,5 +5,5 @@ resolver = "2" [patch.crates-io] curve25519-dalek = { git = 'https://github.com/signalapp/curve25519-dalek', tag = 'signal-curve25519-4.1.3' } -# [patch."https://github.com/whisperfish/libsignal-service-rs.git"] -# libsignal-service = { path = "../libsignal-service-rs" } +[patch."https://github.com/whisperfish/libsignal-service-rs.git"] +libsignal-service = { path = "../libsignal-service-rs" } diff --git a/presage-cli/src/main.rs b/presage-cli/src/main.rs index 9ff8a3621..620230790 100644 --- a/presage-cli/src/main.rs +++ b/presage-cli/src/main.rs @@ -398,7 +398,7 @@ fn print_message( Sent(&'a Thread, String), } - if let Some(msg) = match &content.body { + if let Some(msg) = match &dbg!(content).body { ContentBody::NullMessage(_) => Some(Msg::Received( &thread, "Null message (for example deleted)".to_string(), diff --git a/presage/src/manager/registered.rs b/presage/src/manager/registered.rs index ee15dc4b7..466535b67 100644 --- a/presage/src/manager/registered.rs +++ b/presage/src/manager/registered.rs @@ -1005,7 +1005,7 @@ impl Manager { .. }) => { if timer.is_none() { - *timer = store_expire_timer.map(|(t, _)| t); + *timer = store_expire_timer.map(|(t, _)| t).filter(|t| t > &0); *version = Some(store_expire_timer.map(|(_, v)| v).unwrap_or_default()); } else { *version = Some(store_expire_timer.map(|(_, v)| v).unwrap_or_default() + 1);