Use the user.id instead of nickname in report URLs
authorfeld <feld@feld.me>
Sun, 6 Oct 2019 14:13:04 +0000 (14:13 +0000)
committerAriadne Conill <ariadne@dereferenced.org>
Sun, 6 Oct 2019 14:48:37 +0000 (14:48 +0000)
Ensures links to profiles of remote users work.

CHANGELOG.md
lib/pleroma/emails/admin_email.ex
test/emails/admin_email_test.exs

index 79f867e629a6737bf803c812d00b1cb8cec7f20a..5229fe47a39e00cf0ac8e4f6c937e1bbde226817 100644 (file)
@@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
 - ActivityPub: Correct addressing of Undo.
 - ActivityPub: Correct addressing of profile update activities.
 - Mastodon API: Ensure the `account` field is not empty when rendering Notification entities.
+- Report emails now include functional links to profiles of remote user accounts
 
 ### Removed
 - ActivityPub: The `/objects/:uuid/likes` endpoint.
index c14be02dd98ce0f21869d3d2f8e161ad78b647ee..5a0903c13143754a44fd49fbfad7c170cd950da8 100644 (file)
@@ -17,7 +17,7 @@ defmodule Pleroma.Emails.AdminEmail do
   end
 
   defp user_url(user) do
-    Helpers.o_status_url(Pleroma.Web.Endpoint, :feed_redirect, user.nickname)
+    Helpers.o_status_url(Pleroma.Web.Endpoint, :feed_redirect, user.id)
   end
 
   def report(to, reporter, account, statuses, comment) do
index 9e83c73c62f0cf0197b3d044bd9003fffa276572..594f03959c8d6c4ff091a824521096297376f631 100644 (file)
@@ -19,8 +19,8 @@ defmodule Pleroma.Emails.AdminEmailTest 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.o_status_url(Pleroma.Web.Endpoint, :feed_redirect, reporter.nickname)
-    account_url = Helpers.o_status_url(Pleroma.Web.Endpoint, :feed_redirect, account.nickname)
+    reporter_url = Helpers.o_status_url(Pleroma.Web.Endpoint, :feed_redirect, reporter.id)
+    account_url = Helpers.o_status_url(Pleroma.Web.Endpoint, :feed_redirect, account.id)
 
     assert res.to == [{to_user.name, to_user.email}]
     assert res.from == {config[:name], config[:notify_email]}