Skip to content

Commit e7e5658

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 845c50c commit e7e5658

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
@@ -1432,7 +1432,7 @@ impl MimeFactory {
14321432
"Chat-Content",
14331433
mail_builder::headers::text::Text::new("group-avatar-changed").into(),
14341434
));
1435-
if grpimage.is_none() {
1435+
if grpimage.is_none() && is_encrypted {
14361436
headers.push((
14371437
"Chat-Group-Avatar",
14381438
mail_builder::headers::raw::Raw::new("0").into(),
@@ -1559,7 +1559,7 @@ impl MimeFactory {
15591559
_ => {}
15601560
}
15611561

1562-
if let Some(grpimage) = grpimage {
1562+
if let (Some(grpimage), true) = (grpimage, is_encrypted) {
15631563
info!(context, "setting group image '{}'", grpimage);
15641564
let avatar = build_avatar_file(context, grpimage)
15651565
.await

0 commit comments

Comments
 (0)