From ca1052059372027d05a6133b95176b40954355d7 Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Sun, 8 Mar 2020 12:38:00 -0500 Subject: 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 --- app/lib/activitypub/activity/create.rb | 6 +++++- app/models/form/admin_settings.rb | 2 ++ app/views/admin/settings/edit.html.haml | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'app') 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') -- cgit