Merge commit '6c3bd944f8890e1a349bd06e9585cb5ec25507e6' into glitch-soc/merge-upstream
This commit is contained in:
commit
ddc7df2064
44 files changed
+230
-48
No files matched your search
@@ -7,6 +7,7 @@ class ReportService < BaseService
|
||||
@source_account = source_account
|
||||
@target_account = target_account
|
||||
@status_ids = options.delete(:status_ids).presence || []
|
||||
@collection_ids = options.delete(:collection_ids).presence || []
|
||||
@comment = options.delete(:comment).presence || ''
|
||||
@category = options[:rule_ids].present? ? 'violation' : (options.delete(:category).presence || 'other')
|
||||
@rule_ids = options.delete(:rule_ids).presence
|
||||
@@ -32,6 +33,7 @@ class ReportService < BaseService
|
||||
@report = @source_account.reports.create!(
|
||||
target_account: @target_account,
|
||||
status_ids: reported_status_ids,
|
||||
collection_ids: reported_collection_ids,
|
||||
comment: @comment,
|
||||
uri: @options[:uri],
|
||||
forwarded: forward_to_origin?,
|
||||
@@ -91,6 +93,10 @@ class ReportService < BaseService
|
||||
scope.where(id: Array(@status_ids)).pluck(:id)
|
||||
end
|
||||
|
||||
def reported_collection_ids
|
||||
@target_account.collections.find(Array(@collection_ids)).pluck(:id)
|
||||
end
|
||||
|
||||
def payload
|
||||
Oj.dump(serialize_payload(@report, ActivityPub::FlagSerializer, account: some_local_account))
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user