target comments of @link2xt, fix ci

This commit is contained in:
B. Petersen
2020-03-09 12:11:01 +01:00
committed by Alexander Krotov
parent 9f19d20344
commit be0afdebfd
3 changed files with 9 additions and 18 deletions

View File

@@ -376,11 +376,12 @@ char* dc_get_blobdir (const dc_context_t* context);
* - `delete_device_after` = 0=do not delete messages from device automatically (default), * - `delete_device_after` = 0=do not delete messages from device automatically (default),
* >=1=seconds, after which messages are deleted automatically from the device. * >=1=seconds, after which messages are deleted automatically from the device.
* Messages in the "saved messages" chat (see dc_chat_is_self_talk()) are skipped. * Messages in the "saved messages" chat (see dc_chat_is_self_talk()) are skipped.
* Messages are deleted whether they were seen or not, the UI should clearly point that out.
* - `delete_server_after` = 0=do not delete messages from server automatically (default), * - `delete_server_after` = 0=do not delete messages from server automatically (default),
* >=1=seconds, after which messages are deleted automatically from the server. * >=1=seconds, after which messages are deleted automatically from the server.
* Messages in the "saved messages" chat (see dc_chat_is_self_talk()) are skipped.
* Also emails matching the `show_emails` settings above are deleted from the server, * Also emails matching the `show_emails` settings above are deleted from the server,
* the UI should clearly point that out. * the UI should clearly point that out.
* Messages in the "saved messages" chat (see dc_chat_is_self_talk()) are skipped.
* *
* If you want to retrieve a value, use dc_get_config(). * If you want to retrieve a value, use dc_get_config().
* *
@@ -1305,7 +1306,7 @@ int dc_get_fresh_msg_cnt (dc_context_t* context, uint32_t ch
/** /**
* Estimte the number of messages that will be deleted * Estimate the number of messages that will be deleted
* by the dc_set_config()-options `delete_device_after` or `delete_server_after`. * by the dc_set_config()-options `delete_device_after` or `delete_server_after`.
* This is typically used to show the estimated impact to the user before actually enabling ephemeral messages. * This is typically used to show the estimated impact to the user before actually enabling ephemeral messages.
* *

View File

@@ -1058,7 +1058,7 @@ pub unsafe extern "C" fn dc_estimate_deletion_cnt(
let ffi_context = &*context; let ffi_context = &*context;
ffi_context ffi_context
.with_inner(|ctx| { .with_inner(|ctx| {
message::estimate_deletion_cnt(ctx, from_server as bool, seconds).unwrap_or(0) message::estimate_deletion_cnt(ctx, from_server != 0, seconds).unwrap_or(0)
as libc::c_int as libc::c_int
}) })
.unwrap_or(0) .unwrap_or(0)

View File

@@ -1385,17 +1385,10 @@ pub fn estimate_deletion_cnt(
"SELECT COUNT(*) "SELECT COUNT(*)
FROM msgs m FROM msgs m
WHERE m.id > ? WHERE m.id > ?
AND (state = ? OR state >= ?)
AND chat_id != ?
AND timestamp < ? AND timestamp < ?
AND chat_id != ?
AND server_uid != 0;", AND server_uid != 0;",
params![ params![DC_MSG_ID_LAST_SPECIAL, threshold_timestamp, self_chat_id],
DC_MSG_ID_LAST_SPECIAL,
MessageState::InSeen,
MessageState::OutFailed,
self_chat_id,
threshold_timestamp
],
|row| row.get(0), |row| row.get(0),
)?; )?;
} else { } else {
@@ -1403,16 +1396,13 @@ pub fn estimate_deletion_cnt(
"SELECT COUNT(*) "SELECT COUNT(*)
FROM msgs m FROM msgs m
WHERE m.id > ? WHERE m.id > ?
AND (state = ? OR state >= ?)
AND chat_id != ?
AND timestamp < ? AND timestamp < ?
AND chat_id != ?;", AND chat_id != ?
AND chat_id != ? AND hidden = 0;",
params![ params![
DC_MSG_ID_LAST_SPECIAL, DC_MSG_ID_LAST_SPECIAL,
MessageState::InSeen,
MessageState::OutFailed,
self_chat_id,
threshold_timestamp, threshold_timestamp,
self_chat_id,
ChatId::new(DC_CHAT_ID_TRASH) ChatId::new(DC_CHAT_ID_TRASH)
], ],
|row| row.get(0), |row| row.get(0),