mirror of
				https://gitlab.com/comunic/comunicapiv3
				synced 2025-11-03 17:14:03 +00:00 
			
		
		
		
	Add legacy background image
This commit is contained in:
		@@ -4,7 +4,7 @@
 | 
				
			|||||||
use serde::Serialize;
 | 
					use serde::Serialize;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use crate::data::user::{User, UserPageStatus, UserID};
 | 
					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::data::error::ResultBoxError;
 | 
				
			||||||
use crate::utils::user_data_utils::user_data_url;
 | 
					use crate::utils::user_data_utils::user_data_url;
 | 
				
			||||||
use crate::data::user::AccountImageVisibility::{EVERYONE, COMUNIC_USERS};
 | 
					use crate::data::user::AccountImageVisibility::{EVERYONE, COMUNIC_USERS};
 | 
				
			||||||
@@ -34,7 +34,8 @@ struct APIAdvancedInfo {
 | 
				
			|||||||
    publicNote: String,
 | 
					    publicNote: String,
 | 
				
			||||||
    noCommentOnHisPage: bool,
 | 
					    noCommentOnHisPage: bool,
 | 
				
			||||||
    allowPostFromFriendOnHisPage: bool,
 | 
					    allowPostFromFriendOnHisPage: bool,
 | 
				
			||||||
    account_creation_time: u64
 | 
					    account_creation_time: u64,
 | 
				
			||||||
 | 
					    backgroundImage: String,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
impl APIUserInfo {
 | 
					impl APIUserInfo {
 | 
				
			||||||
@@ -68,7 +69,8 @@ impl APIUserInfo {
 | 
				
			|||||||
            publicNote: info.public_note.clone().unwrap_or(String::new()),
 | 
					            publicNote: info.public_note.clone().unwrap_or(String::new()),
 | 
				
			||||||
            noCommentOnHisPage: info.block_comments_on_his_page,
 | 
					            noCommentOnHisPage: info.block_comments_on_his_page,
 | 
				
			||||||
            allowPostFromFriendOnHisPage: info.allow_posts_from_friends,
 | 
					            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)
 | 
					        Ok(user)
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										11
									
								
								src/helpers/background_image_helper.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								src/helpers/background_image_helper.rs
									
									
									
									
									
										Normal 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")
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -5,3 +5,4 @@ pub mod account_helper;
 | 
				
			|||||||
pub mod user_helper;
 | 
					pub mod user_helper;
 | 
				
			||||||
pub mod friends_helper;
 | 
					pub mod friends_helper;
 | 
				
			||||||
pub mod custom_emojies_helper;
 | 
					pub mod custom_emojies_helper;
 | 
				
			||||||
 | 
					pub mod background_image_helper;
 | 
				
			||||||
		Reference in New Issue
	
	Block a user