1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-06-20 16:35:17 +00:00

Load post comments

This commit is contained in:
2020-07-05 19:32:28 +02:00
parent a3bb9685ea
commit 27e3dedf51
11 changed files with 140 additions and 4 deletions

14
src/data/comment.rs Normal file
View File

@ -0,0 +1,14 @@
//! # Comment information
//!
//! @author Pierre Hubert
use crate::data::user::UserID;
pub struct Comment {
pub id: u64,
pub time_sent: u64,
pub user_id: UserID,
pub post_id: u64,
pub content: String,
pub image_path: Option<String>,
}

View File

@ -21,4 +21,5 @@ pub mod friend;
pub mod friendship_status;
pub mod post;
pub mod movie;
pub mod survey;
pub mod survey;
pub mod comment;

View File

@ -133,4 +133,12 @@ impl Post {
_ => None,
}
}
/// Check out whether a post is targeting a user page or not
pub fn is_on_user_page(&self) -> bool {
match &self.target_page {
PostPageKind::PAGE_KIND_USER(_) => true,
_ => false,
}
}
}