about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2020-03-08 12:38:00 -0500
committermultiple creatures <dev@multiple-creature.party>2020-03-08 12:38:00 -0500
commitca1052059372027d05a6133b95176b40954355d7 (patch)
treeb861b2cbda14cd47e2b2080529c6b4b587f4a0f4 /app
parent5dd65e0c6fdd8623af09f545991fb5995fe916c1 (diff)
add option to auto-trust accounts (at the time of processing a create note) from servers that don't have a graylist policy set on them
Diffstat (limited to 'app')
-rw-r--r--app/lib/activitypub/activity/create.rb6
-rw-r--r--app/models/form/admin_settings.rb2
-rw-r--r--app/views/admin/settings/edit.html.haml1
3 files changed, 8 insertions, 1 deletions
diff --git a/app/lib/activitypub/activity/create.rb b/app/lib/activitypub/activity/create.rb
index 8fd429059..2c101c6cb 100644
--- a/app/lib/activitypub/activity/create.rb
+++ b/app/lib/activitypub/activity/create.rb
@@ -6,7 +6,11 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
 
     unless known?
       if @options[:announced_by].nil?
-        return reject_payload! if !@options[:requested] && rejecting_unknown?
+        if rejecting_unknown?
+          return reject_payload! if !@options[:requested]
+        elsif !@account.manual_only? && Setting.auto_mark_known && Setting.mark_known_from_posts
+          @account.mark_known!
+        end
       elsif !@account.manual_only? && Setting.auto_mark_known && Setting.mark_known_from_boosts && known?(@options[:announced_by])
         @account.mark_known!
       else
diff --git a/app/models/form/admin_settings.rb b/app/models/form/admin_settings.rb
index 7e68196a7..fa3eabf88 100644
--- a/app/models/form/admin_settings.rb
+++ b/app/models/form/admin_settings.rb
@@ -37,6 +37,7 @@ class Form::AdminSettings
     auto_mark_instance_actors_known
     auto_mark_services_known
     always_mark_instance_actors_known
+    mark_known_from_posts
     mark_known_from_follows
     mark_known_from_mentions
     mark_known_from_boosts
@@ -65,6 +66,7 @@ class Form::AdminSettings
     always_mark_instance_actors_known
     werewolf_status
     spam_check_enabled
+    mark_known_from_posts
     mark_known_from_follows
     mark_known_from_mentions
     mark_known_from_boosts
diff --git a/app/views/admin/settings/edit.html.haml b/app/views/admin/settings/edit.html.haml
index 8e58215ca..bfb7d1cfe 100644
--- a/app/views/admin/settings/edit.html.haml
+++ b/app/views/admin/settings/edit.html.haml
@@ -50,6 +50,7 @@
       = f.input :auto_mark_instance_actors_known, as: :boolean, wrapper: :with_label, label: t('admin.settings.auto_mark_instance_actors_known.title'), hint: t('admin.settings.auto_mark_instance_actors_known.desc_html')
       = f.input :always_mark_instance_actors_known, as: :boolean, wrapper: :with_label, label: t('admin.settings.always_mark_instance_actors_known.title'), hint: t('admin.settings.always_mark_instance_actors_known.desc_html')
     .fields-row__column.fields-row__column-6.fields-group
+      = f.input :mark_known_from_posts, as: :boolean, wrapper: :with_label, label: t('admin.settings.mark_known_from.posts')
       = f.input :mark_known_from_follows, as: :boolean, wrapper: :with_label, label: t('admin.settings.mark_known_from.follows')
       = f.input :mark_known_from_mentions, as: :boolean, wrapper: :with_label, label: t('admin.settings.mark_known_from.mentions')
       = f.input :mark_known_from_boosts, as: :boolean, wrapper: :with_label, label: t('admin.settings.mark_known_from.boosts')