Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Describe your changes

## Repo/gem name with Github repo url

## Branch name

## Issue ticket number and link

## Checklist before requesting a review
- [ ] I have performed a self-review of my code
- [ ] If it is a core feature, I have added thorough tests.
- [ ] Do we need to implement analytics?
- [ ] Will this be part of a product update? If yes, please write one phrase about this update.
8 changes: 8 additions & 0 deletions app/jobs/update_accounts_discoverability_job.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class UpdateAccountsDiscoverabilityJob < ApplicationJob
queue_as :default
retry_on StandardError, attempts: 1

def perform(value)
Account.update_all_discoverability(value)
end
end
7 changes: 6 additions & 1 deletion app/models/account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
# hide_collections :boolean
# inbox_url :string default(""), not null
# indexable :boolean default(FALSE), not null
# is_banned :boolean default(FALSE)
# last_webfingered_at :datetime
# locked :boolean default(FALSE), not null
# memorial :boolean default(FALSE), not null
Expand Down Expand Up @@ -150,4 +149,10 @@ def following_ids(account_id = nil)
(follow_ids + follow_request_ids).uniq
end

def self.update_all_discoverability(value = false)
update_all(
discoverable: value,
indexable: value
)
end
end
18 changes: 11 additions & 7 deletions app/models/domain_block.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@
#
# Table name: domain_blocks
#
# id :bigint(8) not null, primary key
# id :bigint not null, primary key
# domain :string default(""), not null
# created_at :datetime not null
# updated_at :datetime not null
# severity :integer default("silence")
# reject_media :boolean default(FALSE), not null
# reject_reports :boolean default(FALSE), not null
# obfuscate :boolean default(FALSE), not null
# private_comment :text
# public_comment :text
# obfuscate :boolean default(FALSE), not null
# reject_media :boolean default(FALSE), not null
# reject_reports :boolean default(FALSE), not null
# severity :integer default("silence")
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_domain_blocks_on_domain (domain) UNIQUE
#

class DomainBlock < ApplicationRecord
Expand Down
12 changes: 11 additions & 1 deletion app/models/server_setting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ class ServerSetting < ApplicationRecord
belongs_to :parent, class_name: "ServerSetting", optional: true
has_many :children, class_name: "ServerSetting", foreign_key: "parent_id", dependent: :destroy

after_update :invoke_keyword_schedule, if: :saved_change_to_value?, if: :content_or_spam_filters?
after_update :invoke_keyword_schedule, if: -> { saved_change_to_value? && content_or_spam_filters? }

after_update :update_accounts_discoverable, if: -> { saved_change_to_value? && search_opt_out_filter? }

after_commit :sync_setting

Expand All @@ -45,4 +47,12 @@ def content_or_spam_filters?
def sync_setting
SyncSettingService.new(self).call if saved_change_to_value? && has_parent?
end

def search_opt_out_filter?
name == "Search opt-out"
end

def update_accounts_discoverable
UpdateAccountsDiscoverabilityJob.perform_later(value)
end
end
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- else
= 'Dashboard'
|
= 'Patchwork'
= application_name(0)

%meta{content: "width=device-width,initial-scale=1", name: "viewport"}/
= csrf_meta_tags
Expand Down
18 changes: 2 additions & 16 deletions db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.