1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-01-30 14:03:00 +00:00

Add legacy background image

This commit is contained in:
Pierre HUBERT 2020-06-01 09:49:48 +02:00
parent 56cf021f4a
commit 9d4b60f0ff
3 changed files with 18 additions and 4 deletions

View File

@ -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)

View File

@ -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")
}

View File

@ -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;
pub mod custom_emojies_helper;
pub mod background_image_helper;