From 6d850c46dc439e018323fb3580e708131247457b Mon Sep 17 00:00:00 2001 From: lain Date: Wed, 4 Nov 2020 17:12:47 +0100 Subject: [PATCH 1/2] AdminEmail: Use AP id as user url. --- lib/pleroma/emails/admin_email.ex | 10 +++------- test/pleroma/emails/admin_email_test.exs | 6 +++--- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/lib/pleroma/emails/admin_email.ex b/lib/pleroma/emails/admin_email.ex index 8979db2f8..02274554f 100644 --- a/lib/pleroma/emails/admin_email.ex +++ b/lib/pleroma/emails/admin_email.ex @@ -18,10 +18,6 @@ defp instance_notify_email do Keyword.get(instance_config(), :notify_email, instance_config()[:email]) end - defp user_url(user) do - Helpers.user_feed_url(Pleroma.Web.Endpoint, :feed_redirect, user.id) - end - def test_email(mail_to \\ nil) do html_body = """

Instance Test Email

@@ -69,8 +65,8 @@ def report(to, reporter, account, statuses, comment) do end html_body = """ -

Reported by: #{reporter.nickname}

-

Reported Account: #{account.nickname}

+

Reported by: #{reporter.nickname}

+

Reported Account: #{account.nickname}

#{comment_html} #{statuses_html}

@@ -86,7 +82,7 @@ def report(to, reporter, account, statuses, comment) do def new_unapproved_registration(to, account) do html_body = """ -

New account for review: @#{account.nickname}

+

New account for review: @#{account.nickname}

#{HTML.strip_tags(account.registration_reason)}
Visit AdminFE """ diff --git a/test/pleroma/emails/admin_email_test.exs b/test/pleroma/emails/admin_email_test.exs index 155057f3e..0da0699cc 100644 --- a/test/pleroma/emails/admin_email_test.exs +++ b/test/pleroma/emails/admin_email_test.exs @@ -19,8 +19,8 @@ test "build report email" do AdminEmail.report(to_user, reporter, account, [%{name: "Test", id: "12"}], "Test comment") status_url = Helpers.o_status_url(Pleroma.Web.Endpoint, :notice, "12") - reporter_url = Helpers.user_feed_url(Pleroma.Web.Endpoint, :feed_redirect, reporter.id) - account_url = Helpers.user_feed_url(Pleroma.Web.Endpoint, :feed_redirect, account.id) + reporter_url = reporter.ap_id + account_url = account.ap_id assert res.to == [{to_user.name, to_user.email}] assert res.from == {config[:name], config[:notify_email]} @@ -54,7 +54,7 @@ test "new unapproved registration email" do res = AdminEmail.new_unapproved_registration(to_user, account) - account_url = Helpers.user_feed_url(Pleroma.Web.Endpoint, :feed_redirect, account.id) + account_url = account.ap_id assert res.to == [{to_user.name, to_user.email}] assert res.from == {config[:name], config[:notify_email]} From 5ddf0be208b1a2703f24c907ac5a07cb8ea12f8c Mon Sep 17 00:00:00 2001 From: lain Date: Wed, 4 Nov 2020 17:13:34 +0100 Subject: [PATCH 2/2] Changelog: Add info about admin email user link changes. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a82f7d6c..756939dde 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Minimum lifetime for ephmeral activities changed to 10 minutes and made configurable (`:min_lifetime` option). - Introduced optional dependencies on `ffmpeg`, `ImageMagick`, `exiftool` software packages. Please refer to `docs/installation/optional/media_graphics_packages.md`. - Polls now always return a `voters_count`, even if they are single-choice +- Admin Emails: The ap id is used as the user link in emails now.
API Changes