diff options
author | multiple creatures <dev@multiple-creature.party> | 2020-03-08 12:38:00 -0500 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2020-03-08 12:38:00 -0500 |
commit | ca1052059372027d05a6133b95176b40954355d7 (patch) | |
tree | b861b2cbda14cd47e2b2080529c6b4b587f4a0f4 /app | |
parent | 5dd65e0c6fdd8623af09f545991fb5995fe916c1 (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.rb | 6 | ||||
-rw-r--r-- | app/models/form/admin_settings.rb | 2 | ||||
-rw-r--r-- | app/views/admin/settings/edit.html.haml | 1 |
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') |