Add support to check if commenting is restricted on Fanbox posts

This commit is contained in:
2025-01-09 15:34:00 +08:00
parent b24632d1d8
commit 25b56fb406

View File

@@ -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 {
@@ -193,6 +198,7 @@ impl CheckUnknown for FanboxPostArticle {
"isPinned"+,
"isRestricted"+,
"likeCount"+,
"isCommentingRestricted",
"nextPost",
"prevPost",
"publishedDatetime"+,
@@ -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())