mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 01:16:31 +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",
|
"Chat-Content",
|
||||||
mail_builder::headers::text::Text::new("group-avatar-changed").into(),
|
mail_builder::headers::text::Text::new("group-avatar-changed").into(),
|
||||||
));
|
));
|
||||||
if grpimage.is_none() {
|
if grpimage.is_none() && is_encrypted {
|
||||||
headers.push((
|
headers.push((
|
||||||
"Chat-Group-Avatar",
|
"Chat-Group-Avatar",
|
||||||
mail_builder::headers::raw::Raw::new("0").into(),
|
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);
|
info!(context, "setting group image '{}'", grpimage);
|
||||||
let avatar = build_avatar_file(context, grpimage)
|
let avatar = build_avatar_file(context, grpimage)
|
||||||
.await
|
.await
|
||||||
|
|||||||
Reference in New Issue
Block a user