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.
This commit is contained in:
iequidoo
2025-09-19 02:14:20 -03:00
committed by iequidoo
parent 4cb129a67e
commit 145a5813e8

View File

@@ -1586,7 +1586,7 @@ impl MimeFactory {
"Chat-Content",
mail_builder::headers::text::Text::new("group-avatar-changed").into(),
));
if grpimage.is_none() {
if grpimage.is_none() && is_encrypted {
headers.push((
"Chat-Group-Avatar",
mail_builder::headers::raw::Raw::new("0").into(),
@@ -1713,7 +1713,9 @@ impl MimeFactory {
_ => {}
}
if let Some(grpimage) = grpimage {
if let Some(grpimage) = grpimage
&& is_encrypted
{
info!(context, "setting group image '{}'", grpimage);
let avatar = build_avatar_file(context, grpimage)
.await