1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-06-21 08:55:16 +00:00

Start to return advanced user info

This commit is contained in:
2020-06-01 09:19:29 +02:00
parent 9915e9af23
commit a0f105090d
5 changed files with 51 additions and 1 deletions

View File

@ -208,6 +208,11 @@ impl<'a> RowResult<'a> {
}))
}
}
/// Get legacy boolean value : 1 = true / 0 = false
pub fn get_legacy_bool(&self, name: &str) -> ResultBoxError<bool> {
Ok(self.get_int64(name)? == 1)
}
}

View File

@ -52,6 +52,12 @@ fn exec_get_user_query(query: database::QueryInfo) -> ResultBoxError<User> {
virtual_directory: res.get_optional_str("sous_repertoire")?,
account_image_path: res.get_optional_str("account_image_path")?,
account_image_visibility,
public_friends_list: res.get_legacy_bool("liste_amis_publique")?,
personal_website: res.get_optional_str("site_web")?,
public_note: res.get_optional_str("public_note")?,
block_comments_on_his_page: res.get_legacy_bool("bloquecommentaire")?,
allow_posts_from_friends: res.get_legacy_bool("autoriser_post_amis")?,
account_creation_time: 10,//TODO : parse date
})
})
}