Function deltachat::contact::set_profile_image

source ·
pub(crate) async fn set_profile_image(
    context: &Context,
    contact_id: ContactId,
    profile_image: &AvatarAction,
    was_encrypted: bool
) -> Result<()>
Expand description

Set profile image for a contact.

The given profile image is expected to be already in the blob directory as profile images can be set only by receiving messages, this should be always the case, however.

For contact SELF, the image is not saved in the contact-database but as Config::Selfavatar; this typically happens if we see message with our own profile image.