@@ -778,6 +778,11 @@ async fn add_parts(
778
778
}
779
779
}
780
780
781
+ if chat_id. is_none ( ) && is_mdn {
782
+ chat_id = Some ( DC_CHAT_ID_TRASH ) ;
783
+ info ! ( context, "Message is an MDN (TRASH)." , ) ;
784
+ }
785
+
781
786
if mime_parser. incoming {
782
787
to_id = ContactId :: SELF ;
783
788
@@ -789,11 +794,6 @@ async fn add_parts(
789
794
markseen_on_imap_table ( context, rfc724_mid) . await . ok ( ) ;
790
795
}
791
796
792
- if chat_id. is_none ( ) && is_mdn {
793
- chat_id = Some ( DC_CHAT_ID_TRASH ) ;
794
- info ! ( context, "Message is an MDN (TRASH)." , ) ;
795
- }
796
-
797
797
let create_blocked_default = if is_bot {
798
798
Blocked :: Not
799
799
} else {
@@ -977,7 +977,6 @@ async fn add_parts(
977
977
// the 1:1 chat accordingly.
978
978
let chat = match is_partial_download. is_none ( )
979
979
&& mime_parser. get_header ( HeaderDef :: SecureJoin ) . is_none ( )
980
- && !is_mdn
981
980
{
982
981
true => Some ( Chat :: load_from_db ( context, chat_id) . await ?)
983
982
. filter ( |chat| chat. typ == Chattype :: Single ) ,
@@ -1236,7 +1235,7 @@ async fn add_parts(
1236
1235
}
1237
1236
1238
1237
let orig_chat_id = chat_id;
1239
- let mut chat_id = if is_mdn || is_reaction {
1238
+ let mut chat_id = if is_reaction {
1240
1239
DC_CHAT_ID_TRASH
1241
1240
} else {
1242
1241
chat_id. unwrap_or_else ( || {
@@ -1694,7 +1693,7 @@ RETURNING id
1694
1693
"Message has {icnt} parts and is assigned to chat #{chat_id}."
1695
1694
) ;
1696
1695
1697
- if !is_mdn {
1696
+ if !chat_id . is_trash ( ) {
1698
1697
let mut chat = Chat :: load_from_db ( context, chat_id) . await ?;
1699
1698
1700
1699
// In contrast to most other update-timestamps,
0 commit comments