diff --git a/app/views/admin/reports/_comment.html.haml b/app/views/admin/reports/_comment.html.haml index 2b3af15c49..9ccd05eb24 100644 --- a/app/views/admin/reports/_comment.html.haml +++ b/app/views/admin/reports/_comment.html.haml @@ -1,12 +1,12 @@ - if report.account.instance_actor? %p= t('admin.reports.comment_description_html', name: content_tag(:strong, site_hostname, class: 'username')) -- elsif report.account.local? +- elsif report.local? %p= t('admin.reports.comment_description_html', name: content_tag(:strong, report.account.username, class: 'username')) - else %p= t('admin.reports.comment_description_html', name: t('admin.reports.remote_user_placeholder', instance: report.account.domain)) .report-notes .report-notes__item - - if report.account.local? && !report.account.instance_actor? + - if report.local? && !report.account.instance_actor? = image_tag report.account.avatar.url, class: 'report-notes__item__avatar' - else = image_tag(full_asset_url('avatars/original/missing.png', skip_pipeline: true), class: 'report-notes__item__avatar') @@ -14,7 +14,7 @@ %span.username - if report.account.instance_actor? = site_hostname - - elsif report.account.local? + - elsif report.local? = link_to report.account.username, admin_account_path(report.account_id) - else = link_to report.account.domain, admin_instance_path(report.account.domain) diff --git a/app/views/admin/reports/_header_details.html.haml b/app/views/admin/reports/_header_details.html.haml index cf81670845..91242f0eaf 100644 --- a/app/views/admin/reports/_header_details.html.haml +++ b/app/views/admin/reports/_header_details.html.haml @@ -10,7 +10,7 @@ .report-header__details__item__content - if report.account.instance_actor? = site_hostname - - elsif report.account.local? + - elsif report.local? = admin_account_link_to report.account - else = report.account.domain @@ -28,7 +28,7 @@ = t('admin.reports.resolved') - else = t('admin.reports.unresolved') - - if report.account.local? && !report.target_account.local? + - if report.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/index.html.haml b/app/views/admin/reports/index.html.haml index e08218a05d..b910e1aab5 100644 --- a/app/views/admin/reports/index.html.haml +++ b/app/views/admin/reports/index.html.haml @@ -51,7 +51,7 @@ .report-card__summary__item__reported-by - if report.account.instance_actor? = site_hostname - - elsif report.account.local? + - elsif report.local? = admin_account_link_to report.account - else = report.account.domain diff --git a/app/views/admin/reports/show.html.haml b/app/views/admin/reports/show.html.haml index 86f87f197e..af92b05768 100644 --- a/app/views/admin/reports/show.html.haml +++ b/app/views/admin/reports/show.html.haml @@ -7,7 +7,7 @@ - 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? +- unless @report.local? || @report.target_account.local? .flash-message= t('admin.reports.forwarded_replies_explanation') .report-header diff --git a/app/views/admin_mailer/new_report.text.erb b/app/views/admin_mailer/new_report.text.erb index 8482225abe..1b7355ada8 100644 --- a/app/views/admin_mailer/new_report.text.erb +++ b/app/views/admin_mailer/new_report.text.erb @@ -1,3 +1,3 @@ -<%= raw(@report.account.local? ? t('admin_mailer.new_report.body', target: @report.target_account.pretty_acct, reporter: @report.account.pretty_acct) : t('admin_mailer.new_report.body_remote', target: @report.target_account.acct, domain: @report.account.domain)) %> +<%= raw(@report.local? ? t('admin_mailer.new_report.body', target: @report.target_account.pretty_acct, reporter: @report.account.pretty_acct) : t('admin_mailer.new_report.body_remote', target: @report.target_account.acct, domain: @report.account.domain)) %> <%= raw t('application_mailer.view')%> <%= admin_report_url(@report) %> diff --git a/spec/models/report_spec.rb b/spec/models/report_spec.rb index 0bee7dfed1..3fa545ee04 100644 --- a/spec/models/report_spec.rb +++ b/spec/models/report_spec.rb @@ -156,6 +156,10 @@ RSpec.describe Report do end end + describe 'Delegations' do + it { is_expected.to delegate_method(:local?).to(:account) } + end + describe 'Validations' do let(:remote_account) { Fabricate(:account, domain: 'example.com', protocol: :activitypub, inbox_url: 'http://example.com/inbox') }