From 9d4b60f0ff95ed5153cb1b5cc3e1544937a5188b Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 1 Jun 2020 09:49:48 +0200 Subject: [PATCH] Add legacy background image --- src/api_data/user_info.rs | 8 +++++--- src/helpers/background_image_helper.rs | 11 +++++++++++ src/helpers/mod.rs | 3 ++- 3 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 src/helpers/background_image_helper.rs diff --git a/src/api_data/user_info.rs b/src/api_data/user_info.rs index d35dd52..06b83f5 100644 --- a/src/api_data/user_info.rs +++ b/src/api_data/user_info.rs @@ -4,7 +4,7 @@ use serde::Serialize; use crate::data::user::{User, UserPageStatus, UserID}; -use crate::helpers::{friends_helper, custom_emojies_helper}; +use crate::helpers::{friends_helper, custom_emojies_helper, background_image_helper}; use crate::data::error::ResultBoxError; use crate::utils::user_data_utils::user_data_url; use crate::data::user::AccountImageVisibility::{EVERYONE, COMUNIC_USERS}; @@ -34,7 +34,8 @@ struct APIAdvancedInfo { publicNote: String, noCommentOnHisPage: bool, allowPostFromFriendOnHisPage: bool, - account_creation_time: u64 + account_creation_time: u64, + backgroundImage: String, } impl APIUserInfo { @@ -68,7 +69,8 @@ impl APIUserInfo { publicNote: info.public_note.clone().unwrap_or(String::new()), noCommentOnHisPage: info.block_comments_on_his_page, allowPostFromFriendOnHisPage: info.allow_posts_from_friends, - account_creation_time: info.account_creation_time + account_creation_time: info.account_creation_time, + backgroundImage: background_image_helper::get_url(info.id), }); Ok(user) diff --git a/src/helpers/background_image_helper.rs b/src/helpers/background_image_helper.rs new file mode 100644 index 0000000..add71f6 --- /dev/null +++ b/src/helpers/background_image_helper.rs @@ -0,0 +1,11 @@ +//! # Background Image Helper +//! +//! This is a legacy module. Background image are not +//! Planned to be implemented anymore + +use crate::data::user::UserID; +use crate::utils::user_data_utils::user_data_url; + +pub fn get_url(_user_id: UserID) -> String { + user_data_url("imgfond/0.jpg") +} \ No newline at end of file diff --git a/src/helpers/mod.rs b/src/helpers/mod.rs index 55734c0..e62da7e 100644 --- a/src/helpers/mod.rs +++ b/src/helpers/mod.rs @@ -4,4 +4,5 @@ pub mod api_helper; pub mod account_helper; pub mod user_helper; pub mod friends_helper; -pub mod custom_emojies_helper; \ No newline at end of file +pub mod custom_emojies_helper; +pub mod background_image_helper; \ No newline at end of file