Skip to content

Commit 6fe6723

Browse files
authored
feat: Remove "Download maximum available until" and remove stock string DC_STR_DOWNLOAD_AVAILABILITY (#7369)
Remove "Download maximum available until", because it's unreliable - chatmail servers may delete full-messages quicker. This is part of #7367
1 parent 2ada3cd commit 6fe6723

File tree

3 files changed

+1
-28
lines changed

3 files changed

+1
-28
lines changed

deltachat-ffi/deltachat.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7247,13 +7247,6 @@ void dc_event_unref(dc_event_t* event);
72477247
/// `%1$s` will be replaced by human-readable size (e.g. "1.2 MiB").
72487248
#define DC_STR_PARTIAL_DOWNLOAD_MSG_BODY 99
72497249

7250-
/// "Download maximum available until %1$s"
7251-
///
7252-
/// Appended after some separator to @ref DC_STR_PARTIAL_DOWNLOAD_MSG_BODY.
7253-
///
7254-
/// `%1$s` will be replaced by human-readable date and time.
7255-
#define DC_STR_DOWNLOAD_AVAILABILITY 100
7256-
72577250
/// "Multi Device Synchronization"
72587251
///
72597252
/// Used in subjects of outgoing sync messages.

src/download.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use crate::imap::session::Session;
1313
use crate::log::info;
1414
use crate::message::{Message, MsgId, Viewtype};
1515
use crate::mimeparser::{MimeMessage, Part};
16-
use crate::tools::time;
1716
use crate::{EventType, chatlist_events, stock_str};
1817

1918
/// Download limits should not be used below `MIN_DOWNLOAD_LIMIT`.
@@ -234,18 +233,10 @@ impl MimeMessage {
234233
None => "",
235234
Some(_) => "[❗] ",
236235
};
237-
let mut text = format!(
236+
let text = format!(
238237
"{prefix}[{}]",
239238
stock_str::partial_download_msg_body(context, org_bytes).await
240239
);
241-
if let Some(delete_server_after) = context.get_config_delete_server_after().await? {
242-
let until = stock_str::download_availability(
243-
context,
244-
time() + max(delete_server_after, MIN_DELETE_SERVER_AFTER),
245-
)
246-
.await;
247-
text += format!(" [{until}]").as_str();
248-
};
249240

250241
info!(context, "Partial download: {}", text);
251242

src/stock_str.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ use crate::contact::{Contact, ContactId, Origin};
1717
use crate::context::Context;
1818
use crate::message::{Message, Viewtype};
1919
use crate::param::Param;
20-
use crate::tools::timestamp_to_str;
2120

2221
/// Storage for string translations.
2322
#[derive(Debug, Clone)]
@@ -177,9 +176,6 @@ pub enum StockMessage {
177176
#[strum(props(fallback = "%1$s message"))]
178177
PartialDownloadMsgBody = 99,
179178

180-
#[strum(props(fallback = "Download maximum available until %1$s"))]
181-
DownloadAvailability = 100,
182-
183179
#[strum(props(fallback = "Multi Device Synchronization"))]
184180
SyncMsgSubject = 101,
185181

@@ -1178,13 +1174,6 @@ pub(crate) async fn partial_download_msg_body(context: &Context, org_bytes: u32)
11781174
.replace1(size)
11791175
}
11801176

1181-
/// Stock string: `Download maximum available until %1$s`.
1182-
pub(crate) async fn download_availability(context: &Context, timestamp: i64) -> String {
1183-
translated(context, StockMessage::DownloadAvailability)
1184-
.await
1185-
.replace1(&timestamp_to_str(timestamp))
1186-
}
1187-
11881177
/// Stock string: `Incoming Messages`.
11891178
pub(crate) async fn incoming_messages(context: &Context) -> String {
11901179
translated(context, StockMessage::IncomingMessages).await

0 commit comments

Comments
 (0)