53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
# File 'app/models/newsmast_mastodon/community.rb', line 53
def self.default_privacy(user)
return nil unless Object.const_defined?('NewsmastMastodon::CommunityAdmin')
return nil unless defined?(NewsmastMastodon::CommunityAdmin) && NewsmastMastodon::CommunityAdmin.respond_to?(:find_by)
admin = NewsmastMastodon::CommunityAdmin.find_by(
account_id: user.account_id,
is_boost_bot: true,
account_status: NewsmastMastodon::CommunityAdmin.account_statuses['active']
)
return nil unless admin
= NewsmastMastodon::Community.find_by(id: admin.)
return nil unless &.content_type&.group_channel?
case .post_visibility
when 'followers_only'
'private'
when 'public_visibility'
'public'
else
.post_visibility
end
end
|