about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-05-10 03:48:11 -0500
committermultiple creatures <dev@multiple-creature.party>2019-05-21 03:16:23 -0500
commit3b06175e8f5cb9d688e8ec376dbfd88abf5f3278 (patch)
tree160a6f6c97777ca022326bb93701f358fe689c99 /app/lib
parent5c59d1837f2d3152342ef45bf7827495183e62dd (diff)
Moderation: add `force sensitive` and `force unlisted` actions. Accounts: add federatable `adult content` tag. Handle from remote accounts as well.
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/activitypub/activity/create.rb3
-rw-r--r--app/lib/activitypub/adapter.rb1
2 files changed, 4 insertions, 0 deletions
diff --git a/app/lib/activitypub/activity/create.rb b/app/lib/activitypub/activity/create.rb
index 5514d9a6e..f24cfffa8 100644
--- a/app/lib/activitypub/activity/create.rb
+++ b/app/lib/activitypub/activity/create.rb
@@ -34,6 +34,9 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
     process_tags
     process_audience
 
+    @params[:visibility] = :unlisted if @params[:visibility] == :public && @account.force_unlisted?
+    @params[:sensitive] = true if @account.force_sensitive?
+
     ApplicationRecord.transaction do
       @status = Status.create!(@params)
       attach_tags(@status)
diff --git a/app/lib/activitypub/adapter.rb b/app/lib/activitypub/adapter.rb
index 9d940e4ef..4c0231ad7 100644
--- a/app/lib/activitypub/adapter.rb
+++ b/app/lib/activitypub/adapter.rb
@@ -19,6 +19,7 @@ class ActivityPub::Adapter < ActiveModelSerializers::Adapter::Base
     focal_point: { 'toot' => 'http://joinmastodon.org/ns#', 'focalPoint' => { '@container' => '@list', '@id' => 'toot:focalPoint' } },
     identity_proof: { 'toot' => 'http://joinmastodon.org/ns#', 'IdentityProof' => 'toot:IdentityProof' },
     blurhash: { 'toot' => 'http://joinmastodon.org/ns#', 'blurhash' => 'toot:blurhash' },
+    adults_only: { 'schema' => 'http://schema.org#', 'suggestedMinAge' => 'schema:suggestedMinAge' }
   }.freeze
 
   def self.default_key_transform