Skip to content

Commit

Permalink
Add support to check if commenting is restricted on Fanbox posts
Browse files Browse the repository at this point in the history
  • Loading branch information
lifegpc committed Jan 9, 2025
1 parent b24632d commit 25b56fb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/fanbox/post.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ impl FanboxPostArticle {
self.data["likeCount"].as_u64()
}

#[inline]
pub fn is_commenting_restricted(&self) -> Option<bool> {
self.data["isCommentingRestricted"].as_bool()
}

#[inline]
/// Create a new instance
pub fn new(data: &JsonValue, client: Arc<FanboxClientInternal>) -> Self {
Expand Down Expand Up @@ -193,6 +198,7 @@ impl CheckUnknown for FanboxPostArticle {
"isPinned"+,
"isRestricted"+,
"likeCount"+,
"isCommentingRestricted",
"nextPost",
"prevPost",
"publishedDatetime"+,
Expand Down Expand Up @@ -245,6 +251,7 @@ impl Debug for FanboxPostArticle {
.field("is_pinned", &self.is_pinned())
.field("is_restricted", &self.is_restricted())
.field("like_count", &self.like_count())
.field("is_commenting_restricted", &self.is_commenting_restricted())
.field("next_post", &self.next_post())
.field("prev_post", &self.prev_post())
.field("published_datetime", &self.published_datetime())
Expand Down

0 comments on commit 25b56fb

Please sign in to comment.