mirror of
https://github.com/chatmail/core.git
synced 2026-04-29 03:16:29 +03:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user