Browse Source

Fix reports of already suspended accounts being recorded (#16047)

closed-social-v3
Eugen Rochko 7 months ago
committed by GitHub
parent
commit
dde8739020
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions
  1. +2
    -0
      app/lib/activitypub/activity/flag.rb
  2. +2
    -0
      app/services/report_service.rb

+ 2
- 0
app/lib/activitypub/activity/flag.rb View File

@ -10,6 +10,8 @@ class ActivityPub::Activity::Flag < ActivityPub::Activity
target_accounts.each do |target_account|
target_statuses = target_statuses_by_account[target_account.id]
next if target_account.suspended?
ReportService.new.call(
@account,
target_account,

+ 2
- 0
app/services/report_service.rb View File

@ -10,6 +10,8 @@ class ReportService < BaseService
@comment = options.delete(:comment) || ''
@options = options
raise ActiveRecord::RecordNotFound if @target_account.suspended?
create_report!
notify_staff!
forward_to_origin! if !@target_account.local? && ActiveModel::Type::Boolean.new.cast(@options[:forward])

Loading…
Cancel
Save