Skip to content

Commit 3f3574e

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 b7f86a3 commit 3f3574e

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
@@ -1431,7 +1431,7 @@ impl MimeFactory {
14311431
"Chat-Content",
14321432
mail_builder::headers::text::Text::new("group-avatar-changed").into(),
14331433
));
1434-
if grpimage.is_none() {
1434+
if grpimage.is_none() && is_encrypted {
14351435
headers.push((
14361436
"Chat-Group-Avatar",
14371437
mail_builder::headers::raw::Raw::new("0").into(),
@@ -1543,7 +1543,7 @@ impl MimeFactory {
15431543
_ => {}
15441544
}
15451545

1546-
if let Some(grpimage) = grpimage {
1546+
if let (Some(grpimage), true) = (grpimage, is_encrypted) {
15471547
info!(context, "setting group image '{}'", grpimage);
15481548
let avatar = build_avatar_file(context, grpimage)
15491549
.await

0 commit comments

Comments
 (0)