mirror of
https://github.com/chatmail/core.git
synced 2026-10-02 11:10:25 +03:00
fix: do not fail to receive post-message with status updates for deleted webxdc
receive_imf should not fail in this case, but trash the post-message and updates. The problem with previously used message::rfc724_mid_exists check was that rfc724_mid_exists may return a trashed message.
This commit is contained in:
+6
-11
@@ -835,21 +835,16 @@ UPDATE config SET value=? WHERE keyname='configured_addr' AND value!=?1
|
||||
{
|
||||
can_info_msg = false;
|
||||
if mime_parser.pre_message == PreMessageMode::Post
|
||||
&& let Some(msg_id) = message::rfc724_mid_exists(context, rfc724_mid_orig).await?
|
||||
&& let Some(msg) =
|
||||
Message::load_by_rfc724_mid_optional(context, rfc724_mid_orig).await?
|
||||
{
|
||||
// The messsage is a post-message and pre-message exists.
|
||||
// Assign status update to existing message because just received post-message will be trashed.
|
||||
Some(
|
||||
Message::load_from_db(context, msg_id)
|
||||
.await
|
||||
.context("Failed to load webxdc instance that we just checked exists")?,
|
||||
)
|
||||
Some(msg)
|
||||
} else {
|
||||
Some(
|
||||
Message::load_from_db(context, insert_msg_id)
|
||||
.await
|
||||
.context("Failed to load just created webxdc instance")?,
|
||||
)
|
||||
Message::load_from_db_optional(context, insert_msg_id)
|
||||
.await
|
||||
.context("Failed to load just created webxdc instance")?
|
||||
}
|
||||
} else if let Some(field) = mime_parser.get_header(HeaderDef::InReplyTo) {
|
||||
if let Some(instance) =
|
||||
|
||||
Reference in New Issue
Block a user