[Favorites] Add the missing methods (#866)

This commit is contained in:
Cinder 2025-01-29 12:54:18 -08:00 committed by GitHub
parent d961d86563
commit 90c7248e2e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -28,10 +28,22 @@ module PostSets
end
end
def has_explicit?
!CurrentUser.safe_mode?
end
def hidden_posts
@hidden_posts ||= posts.reject(&:visible?)
end
def login_blocked_posts
@login_blocked_posts ||= posts.select(&:loginblocked?)
end
def safe_posts
@safe_posts ||= posts.select { |p| p.safeblocked? && !p.deleteblocked? }
end
def api_posts
result = posts
fill_children(result)