Skip to content

Commit ddc5373

Browse files
committed
fix: Make reaction message hidden only if there are no other parts
RFC 9078 "Reaction: ..." doesn't forbid messages with reactions to have other parts, so be prepared for this.
1 parent 3656337 commit ddc5373

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/receive_imf.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,6 @@ pub(crate) async fn receive_imf_inner(
763763
let show_emails = ShowEmails::from_i32(context.get_config_int(Config::ShowEmails).await?)
764764
.unwrap_or_default();
765765

766-
let is_reaction = mime_parser.parts.iter().any(|part| part.is_reaction);
767766
let allow_creation = if mime_parser.decrypting_failed {
768767
false
769768
} else if mime_parser.is_system_message != SystemMessage::AutocryptSetupMessage
@@ -777,7 +776,7 @@ pub(crate) async fn receive_imf_inner(
777776
ShowEmails::All => true,
778777
}
779778
} else {
780-
!is_reaction
779+
!mime_parser.parts.iter().all(|part| part.is_reaction)
781780
};
782781

783782
let to_id = if mime_parser.incoming {
@@ -1995,10 +1994,10 @@ async fn add_parts(
19951994

19961995
handle_edit_delete(context, mime_parser, from_id).await?;
19971996

1998-
let is_reaction = mime_parser.parts.iter().any(|part| part.is_reaction);
1999-
let hidden = is_reaction;
1997+
let hidden = mime_parser.parts.iter().all(|part| part.is_reaction);
20001998
let mut parts = mime_parser.parts.iter().peekable();
20011999
while let Some(part) = parts.next() {
2000+
let hidden = part.is_reaction;
20022001
if part.is_reaction {
20032002
let reaction_str = simplify::remove_footers(part.msg.as_str());
20042003
let is_incoming_fresh = mime_parser.incoming && !seen;

0 commit comments

Comments
 (0)