diff --git a/app/helpers/registration_limitation_helper.rb b/app/helpers/registration_limitation_helper.rb index 65e295720c..4ac04450aa 100644 --- a/app/helpers/registration_limitation_helper.rb +++ b/app/helpers/registration_limitation_helper.rb @@ -32,20 +32,22 @@ module RegistrationLimitationHelper end def registrations_in_time? - start_hour = Setting.registrations_start_hour || 0 - end_hour = Setting.registrations_end_hour || 24 - secondary_start_hour = Setting.registrations_secondary_start_hour || 0 - secondary_end_hour = Setting.registrations_secondary_end_hour || 0 + start_hour = Setting.registrations_start_hour + end_hour = Setting.registrations_end_hour + secondary_start_hour = Setting.registrations_secondary_start_hour + secondary_end_hour = Setting.registrations_secondary_end_hour + + start_hour = 0 unless start_hour.is_a?(Integer) + end_hour = 0 unless end_hour.is_a?(Integer) + secondary_start_hour = 0 unless secondary_start_hour.is_a?(Integer) + secondary_end_hour = 0 unless secondary_end_hour.is_a?(Integer) return true if start_hour >= end_hour && secondary_start_hour >= secondary_end_hour current_hour = Time.now.utc.hour - primary_permitted = false - primary_permitted = start_hour <= current_hour && current_hour < end_hour if start_hour < end_hour && end_hour.positive? - secondary_permitted = false - secondary_permitted = secondary_start_hour <= current_hour && current_hour < secondary_end_hour if secondary_start_hour < secondary_end_hour && secondary_end_hour.positive? - primary_permitted || secondary_permitted + (start_hour < end_hour && end_hour.positive? && current_hour.between?(start_hour, end_hour - 1)) || + (secondary_start_hour < secondary_end_hour && secondary_end_hour.positive? && current_hour.between?(secondary_start_hour, secondary_end_hour - 1)) end def reset_registration_limit_caches! diff --git a/app/models/form/account_batch.rb b/app/models/form/account_batch.rb index aec6192628..6f5af9d1f0 100644 --- a/app/models/form/account_batch.rb +++ b/app/models/form/account_batch.rb @@ -117,6 +117,8 @@ class Form::AccountBatch accounts.find_each do |account| if account.user_pending? reject_account(account) + elsif account.suspended? && account.remote_pending + reject_remote_account(account) else suspend_account(account) end diff --git a/app/services/activitypub/process_account_service.rb b/app/services/activitypub/process_account_service.rb index 632de6091d..c9f17bdd45 100644 --- a/app/services/activitypub/process_account_service.rb +++ b/app/services/activitypub/process_account_service.rb @@ -141,7 +141,6 @@ class ActivityPub::ProcessAccountService < BaseService def blocking_new_account? return false unless Setting.hold_remote_new_accounts - return false if permit_new_account_domains.blank? permit_new_account_domains.exclude?(@domain) end diff --git a/config/locales/en.yml b/config/locales/en.yml index 8a5e5a4a3a..ccaf72a417 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -661,7 +661,7 @@ en: post_mentions_max: Mentions max for posts post_stranger_mentions_max: 投稿に設定可能なメンションの最大数 (If the mentions include at least one person who is not a follower of yours) remote_approval_list: List of remote accounts awaiting approval - remote_approval_hint: If you set one or more domains on the list of domains for which you want to automatically approve new users, newly recognized accounts on unspecified domains will be placed in suspend status. You can review that list and approve them if necessary. If none is specified, all remote accounts are approved immediately. + remote_approval_hint: Newly recognized accounts with unspecified domains will be placed in Suspended status. You can review that list and approve them if necessary. If this setting is not enabled, all remote accounts will be approved immediately. stranger_mention_from_local_ng: フォローしていないアカウントへのメンションのNGワードを、ローカルユーザーによる投稿にも適用する stranger_mention_from_local_ng_hint: サーバーの登録が承認制でない場合、あなたのサーバーにもスパムが入り込む可能性があります test_error: Testing is returned any errors diff --git a/config/locales/ja.yml b/config/locales/ja.yml index d49383038b..e11eb52ce7 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -654,7 +654,7 @@ ja: post_mentions_max: 投稿に設定可能なメンションの最大数 post_stranger_mentions_max: 投稿に設定可能なメンションの最大数 (メンション先にフォロワー以外を1人でも含む場合) remote_approval_list: 承認待ちのリモートアカウント一覧 - remote_approval_hint: 新規ユーザーを自動承認するドメインリストに1つ以上のドメインを設定すると、指定されていないドメインで新しく認識されたアカウントはサスペンド状態になります。その一覧を確認し、必要であれば承認を行うことができます。何も指定しなかった場合、全てのリモートアカウントが即座に承認されます。 + remote_approval_hint: 指定されていないドメインで新しく認識されたアカウントはサスペンド状態になります。その一覧を確認し、必要であれば承認を行うことができます。この設定が有効でない場合、全てのリモートアカウントが即座に承認されます。 stranger_mention_from_local_ng: フォローしていないアカウントへのメンションのNGワードを、ローカルユーザーによる投稿にも適用する stranger_mention_from_local_ng_hint: サーバーの登録が承認制でない場合、あなたのサーバーにもスパムが入り込む可能性があります test_error: NGワードのテストに失敗しました。正規表現のミスが含まれているかもしれません diff --git a/lib/mastodon/version.rb b/lib/mastodon/version.rb index 06563f3501..6676ee99d7 100644 --- a/lib/mastodon/version.rb +++ b/lib/mastodon/version.rb @@ -14,8 +14,8 @@ module Mastodon def kmyblue_flag # 'LTS' - 'dev' - # nil + # 'dev' + nil end def major diff --git a/spec/services/activitypub/process_account_service_spec.rb b/spec/services/activitypub/process_account_service_spec.rb index c9460f9b18..37817f204a 100644 --- a/spec/services/activitypub/process_account_service_spec.rb +++ b/spec/services/activitypub/process_account_service_spec.rb @@ -29,11 +29,11 @@ RSpec.describe ActivityPub::ProcessAccountService, type: :service do Setting.permit_new_account_domains = permit_new_account_domains end - it 'created account in a simple case' do + it 'creates pending account in a simple case' do expect(subject).to_not be_nil expect(subject.uri).to eq 'https://foo.test' - expect(subject.suspended?).to be false - expect(subject.remote_pending).to be false + expect(subject.suspended?).to be true + expect(subject.remote_pending).to be true end context 'when is blocked' do