Return true for MessageState::OutMdnRcvd.can_fail() because it could be a group message and only some recipients failed

This commit is contained in:
Hocuri
2020-06-06 18:00:22 +02:00
parent 6ded0d3bc1
commit 6b763bf417

View File

@@ -766,9 +766,10 @@ impl From<MessageState> for LotState {
impl MessageState { impl MessageState {
pub fn can_fail(self) -> bool { pub fn can_fail(self) -> bool {
match self { match self {
MessageState::OutPreparing | MessageState::OutPending | MessageState::OutDelivered => { MessageState::OutPreparing
true | MessageState::OutPending
} | MessageState::OutDelivered
| MessageState::OutMdnRcvd => true,
_ => false, _ => false,
} }
} }
@@ -1327,10 +1328,7 @@ pub async fn mdn_from_ext(
if let Ok((msg_id, chat_id, chat_type, msg_state)) = res { if let Ok((msg_id, chat_id, chat_type, msg_state)) = res {
let mut read_by_all = false; let mut read_by_all = false;
// if already marked as MDNS_RCVD msgstate_can_fail() returns false. if msg_state != MessageState::OutMdnRcvd && msg_state != MessageState::OutFailed {
// however, it is important, that ret_msg_id is set above as this
// will allow the caller eg. to move the message away
if msg_state.can_fail() {
let mdn_already_in_table = context let mdn_already_in_table = context
.sql .sql
.exists( .exists(