mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-06-20 16:35:17 +00:00
Load post comments
This commit is contained in:
14
src/data/comment.rs
Normal file
14
src/data/comment.rs
Normal 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>,
|
||||
}
|
@ -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;
|
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user