From bd575a1dd69d87ca0f69873f7badf28d38e8b9ed Mon Sep 17 00:00:00 2001
From: Claire <claire.github-309c@sitedethib.com>
Date: Wed, 15 Nov 2023 15:18:43 +0100
Subject: [PATCH] Add banner for forwarded reports made by remote users about
 remote content (#27549)

---
 app/views/admin/reports/_header_details.html.haml | 2 +-
 app/views/admin/reports/show.html.haml            | 3 +++
 config/locales/en.yml                             | 1 +
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/app/views/admin/reports/_header_details.html.haml b/app/views/admin/reports/_header_details.html.haml
index 5878cd2ff8..45790b9cd5 100644
--- a/app/views/admin/reports/_header_details.html.haml
+++ b/app/views/admin/reports/_header_details.html.haml
@@ -22,7 +22,7 @@
         = t('admin.reports.resolved')
       - else
         = t('admin.reports.unresolved')
-  - unless report.target_account.local?
+  - if report.account.local? && !report.target_account.local?
     .report-header__details__item
       .report-header__details__item__header
         %strong= t('admin.reports.forwarded')
diff --git a/app/views/admin/reports/show.html.haml b/app/views/admin/reports/show.html.haml
index 13a4d48344..4376e5af4d 100644
--- a/app/views/admin/reports/show.html.haml
+++ b/app/views/admin/reports/show.html.haml
@@ -7,6 +7,9 @@
   - else
     = link_to t('admin.reports.mark_as_unresolved'), reopen_admin_report_path(@report), method: :post, class: 'button'
 
+- unless @report.account.local? || @report.target_account.local?
+  .flash-message= t('admin.reports.forwarded_replies_explanation')
+
 .report-header
   = render 'admin/reports/header_card', report: @report
   = render 'admin/reports/header_details', report: @report
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 7319de53db..057f7a5841 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -611,6 +611,7 @@ en:
       created_at: Reported
       delete_and_resolve: Delete posts
       forwarded: Forwarded
+      forwarded_replies_explanation: This report is from a remote user and about remote content. It has been forwarded to you because the reported content is in reply to one of your users.
       forwarded_to: Forwarded to %{domain}
       mark_as_resolved: Mark as resolved
       mark_as_sensitive: Mark as sensitive