diff options
author | Maksim Pechnikov <parallel588@gmail.com> | 2020-11-19 22:13:45 +0300 |
---|---|---|
committer | Maksim Pechnikov <parallel588@gmail.com> | 2020-11-19 22:13:45 +0300 |
commit | 66f411fba0ecb350a2cd80293aabdecf402abaf9 (patch) | |
tree | ae00a8e58c42281e531f9d02ada2f13181cfc363 /lib/pleroma/web/admin_api/controllers | |
parent | c8d11c306452ea36f5690ba1824434dc71bd9f95 (diff) | |
download | pleroma-66f411fba0ecb350a2cd80293aabdecf402abaf9.tar.gz |
added subject actor to moderation log
Diffstat (limited to 'lib/pleroma/web/admin_api/controllers')
-rw-r--r-- | lib/pleroma/web/admin_api/controllers/report_controller.ex | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/pleroma/web/admin_api/controllers/report_controller.ex b/lib/pleroma/web/admin_api/controllers/report_controller.ex index 6a0e56f5f..cc77cbfdf 100644 --- a/lib/pleroma/web/admin_api/controllers/report_controller.ex +++ b/lib/pleroma/web/admin_api/controllers/report_controller.ex @@ -50,10 +50,13 @@ defmodule Pleroma.Web.AdminAPI.ReportController do Enum.map(reports, fn report -> case CommonAPI.update_report_state(report.id, report.state) do {:ok, activity} -> + report = Activity.get_by_id_with_user_actor(activity.id) + ModerationLog.insert_log(%{ action: "report_update", actor: admin, - subject: activity + subject: activity, + subject_actor: report.user_actor }) activity @@ -73,11 +76,13 @@ defmodule Pleroma.Web.AdminAPI.ReportController do def notes_create(%{assigns: %{user: user}, body_params: %{content: content}} = conn, %{ id: report_id }) do - with {:ok, _} <- ReportNote.create(user.id, report_id, content) do + with {:ok, _} <- ReportNote.create(user.id, report_id, content), + report <- Activity.get_by_id_with_user_actor(report_id) do ModerationLog.insert_log(%{ action: "report_note", actor: user, - subject: Activity.get_by_id(report_id), + subject: report, + subject_actor: report.user_actor, text: content }) @@ -91,11 +96,13 @@ defmodule Pleroma.Web.AdminAPI.ReportController do id: note_id, report_id: report_id }) do - with {:ok, note} <- ReportNote.destroy(note_id) do + with {:ok, note} <- ReportNote.destroy(note_id), + report <- Activity.get_by_id_with_user_actor(report_id) do ModerationLog.insert_log(%{ action: "report_note_delete", actor: user, - subject: Activity.get_by_id(report_id), + subject: report, + subject_actor: report.user_actor, text: note.content }) |