From 90d8c8baf55777c1988ce534b49c51190c1003d9 Mon Sep 17 00:00:00 2001 From: link2xt Date: Sun, 31 Oct 2021 01:46:33 +0300 Subject: [PATCH] Only apply ephemeral timers to non-special chats --- src/dc_receive_imf.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/dc_receive_imf.rs b/src/dc_receive_imf.rs index 03ec59829..480292e33 100644 --- a/src/dc_receive_imf.rs +++ b/src/dc_receive_imf.rs @@ -854,11 +854,12 @@ async fn add_parts( // Apply ephemeral timer changes to the chat. // - // Only non-hidden timers are applied. Timers from hidden - // messages such as read receipts can be useful to detect - // ephemeral timer support, but timer changes without visible - // received messages may be confusing to the user. - if !location_kml_is && !is_mdn && chat_id.get_ephemeral_timer(context).await? != ephemeral_timer + // Only apply the timer when there are visible parts (e.g., the message does not consist only + // of `location.kml` attachment). Timer changes without visible received messages may be + // confusing to the user. + if !chat_id.is_special() + && !mime_parser.parts.is_empty() + && chat_id.get_ephemeral_timer(context).await? != ephemeral_timer { info!( context,