lots of small fixes from the reviews

This commit is contained in:
Hocuri
2020-06-12 10:00:05 +02:00
parent 8ebce0c861
commit 990c80cedf
4 changed files with 12 additions and 5 deletions

View File

@@ -4428,7 +4428,7 @@ void dc_event_unref(dc_event_t* event);
#define DC_STR_WELCOME_MESSAGE 71
#define DC_STR_UNKNOWN_SENDER_FOR_CHAT 72
#define DC_STR_SUBJECT_FOR_NEW_CONTACT 73
#define FAILED_SENDING_TO 74
#define DC_STR_FAILED_SENDING_TO 74
#define DC_STR_COUNT 74

View File

@@ -769,7 +769,7 @@ impl MessageState {
MessageState::OutPreparing
| MessageState::OutPending
| MessageState::OutDelivered
| MessageState::OutMdnRcvd => true,
| MessageState::OutMdnRcvd => true, // OutMdnRcvd can still fail because it could be a group message and only some recipients failed.
_ => false,
}
}
@@ -1328,7 +1328,10 @@ pub async fn mdn_from_ext(
if let Ok((msg_id, chat_id, chat_type, msg_state)) = res {
let mut read_by_all = false;
if msg_state != MessageState::OutMdnRcvd && msg_state != MessageState::OutFailed {
if msg_state == MessageState::OutPreparing
|| msg_state == MessageState::OutPending
|| msg_state == MessageState::OutDelivered
{
let mdn_already_in_table = context
.sql
.exists(
@@ -1391,6 +1394,8 @@ pub async fn mdn_from_ext(
None
}
/// Marks a message as failed after an ndn (non-delivery-notification) arrived.
/// Where appropriate, also adds an info message telling the user which of the recipients of a group message failed.
pub(crate) async fn ndn_from_ext(
context: &Context,
failed: &FailedMsg,

View File

@@ -933,7 +933,9 @@ impl MimeMessage {
None
}
/// Handle reports (only MDNs for now)
/// Handle reports
/// (MDNs = Message Disposition Notification, the message was read
/// and NDNs = Non delivery notification, the message could not be delivered)
pub async fn handle_reports(
&self,
context: &Context,

View File

@@ -1242,7 +1242,7 @@ async fn open(
sql.set_raw_config_int(context, "dbversion", 63).await?;
}
if dbversion < 64 {
info!(context, "[migration] v63");
info!(context, "[migration] v64");
sql.execute(
"ALTER TABLE msgs ADD COLUMN error TEXT DEFAULT '';",
paramsv![],