fix: Don't send self-avatar in unencrypted messages (#7136)

We don't display avatars for address-contacts, so sending avatars w/o encryption is not useful and
causes e.g. Outlook to reject a message with a big header, see
https://support.delta.chat/t/invalid-mime-content-single-text-value-size-32822-exceeded-allowed-maximum-32768-for-the-chat-user-avatar-header/4067.
This commit is contained in:
iequidoo
2025-09-18 09:45:10 -03:00
committed by iequidoo
parent 7bf7ec3d32
commit 4cb129a67e
2 changed files with 6 additions and 74 deletions

View File

@@ -464,7 +464,11 @@ impl MimeFactory {
.unwrap_or_default(),
false => "".to_string(),
};
let attach_selfavatar = Self::should_attach_selfavatar(context, &msg).await;
// We don't display avatars for address-contacts, so sending avatars w/o encryption is not
// useful and causes e.g. Outlook to reject a message with a big header, see
// https://support.delta.chat/t/invalid-mime-content-single-text-value-size-32822-exceeded-allowed-maximum-32768-for-the-chat-user-avatar-header/4067.
let attach_selfavatar =
Self::should_attach_selfavatar(context, &msg).await && encryption_pubkeys.is_some();
ensure_and_debug_assert!(
member_timestamps.is_empty()