Merge commit 'ce1f35d7e213327549b960bb64f63c67a141ea40' into glitch-soc/merge-upstream

Conflicts:
- `db/schema.rb`:
  Upstream regenerated the schema file using Rails 7, the conflicts are
  caused by our extra columns.
  Applied upstream's changes, but keeping our extra columns.
This commit is contained in:
Claire
2023-07-30 14:58:56 +02:00
172 changed files with 749 additions and 652 deletions

View File

@@ -103,10 +103,6 @@ module HasUserSettings
settings['web.trends']
end
def setting_crop_images
settings['web.crop_images']
end
def setting_disable_swiping
settings['web.disable_swiping']
end

View File

@@ -30,6 +30,7 @@
# max_score_at :datetime
# trendable :boolean
# link_type :integer
# published_at :datetime
#
class PreviewCard < ApplicationRecord

View File

@@ -58,7 +58,8 @@ class Report < ApplicationRecord
before_validation :set_uri, only: :create
after_create_commit :trigger_webhooks
after_create_commit :trigger_create_webhooks
after_update_commit :trigger_update_webhooks
def object_type
:flag
@@ -155,7 +156,11 @@ class Report < ApplicationRecord
errors.add(:rule_ids, I18n.t('reports.errors.invalid_rules')) unless rules.size == rule_ids&.size
end
def trigger_webhooks
def trigger_create_webhooks
TriggerWebhookWorker.perform_async('report.created', 'Report', id)
end
def trigger_update_webhooks
TriggerWebhookWorker.perform_async('report.updated', 'Report', id)
end
end

View File

@@ -20,7 +20,6 @@ class UserSettings
setting :hide_followers_count, default: false
namespace :web do
setting :crop_images, default: true
setting :advanced_layout, default: false
setting :trends, default: true
setting :use_blurhash, default: true

View File

@@ -20,6 +20,7 @@ class Webhook < ApplicationRecord
account.created
account.updated
report.created
report.updated
status.created
status.updated
).freeze
@@ -59,7 +60,7 @@ class Webhook < ApplicationRecord
case event
when 'account.approved', 'account.created', 'account.updated'
:manage_users
when 'report.created'
when 'report.created', 'report.updated'
:manage_reports
when 'status.created', 'status.updated'
:view_devops