Skip to content

Commit f912092

Browse files
committed
feat: Don't send Chat-Group-Avatar header in unencrypted groups
`chat::set_chat_profile_image()` already checks that the group has grpid, still it makes sense to check that a message is encrypted when sending, in case if the chat has a profile image in the db for some reason.
1 parent bd99e97 commit f912092

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/mimefactory.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1586,7 +1586,7 @@ impl MimeFactory {
15861586
"Chat-Content",
15871587
mail_builder::headers::text::Text::new("group-avatar-changed").into(),
15881588
));
1589-
if grpimage.is_none() {
1589+
if grpimage.is_none() && is_encrypted {
15901590
headers.push((
15911591
"Chat-Group-Avatar",
15921592
mail_builder::headers::raw::Raw::new("0").into(),
@@ -1713,7 +1713,7 @@ impl MimeFactory {
17131713
_ => {}
17141714
}
17151715

1716-
if let Some(grpimage) = grpimage {
1716+
if let (Some(grpimage), true) = (grpimage, is_encrypted) {
17171717
info!(context, "setting group image '{}'", grpimage);
17181718
let avatar = build_avatar_file(context, grpimage)
17191719
.await

0 commit comments

Comments
 (0)