address @r10s and @flub review comments, and fix some docstrings/test meta docs

This commit is contained in:
holger krekel
2019-09-09 17:31:43 +02:00
parent 650d8c45ec
commit 5b0c8dd9dd
5 changed files with 19 additions and 27 deletions

View File

@@ -1,6 +1,7 @@
use deltachat_derive::*;
use itertools::Itertools;
use rusqlite;
use std::path::PathBuf;
use crate::aheader::EncryptPreference;
use crate::config::Config;
@@ -766,9 +767,11 @@ impl<'a> Contact<'a> {
/// Get the contact's profile image.
/// This is the image set by each remote user on their own
/// using dc_set_config(context, "selfavatar", image).
pub fn get_profile_image(&self) -> Option<String> {
pub fn get_profile_image(&self) -> Option<PathBuf> {
if self.id == DC_CONTACT_ID_SELF {
return self.context.get_config(Config::Selfavatar);
if let Some(p) = self.context.get_config(Config::Selfavatar) {
return Some(PathBuf::from(p));
}
}
// TODO: else get image_abs from contact param
None