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)
committerfeld <feld@feld.me>
Sun, 6 Oct 2019 14:13:04 +0000 (14:13 +0000)
Ensures links to profiles of remote users work.

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

index db505591b703264ffef0dd1da291316d6634a46a..607643b7c5b0cf3517ae98471869b8c7b161ea63 100644 (file)
@@ -27,6 +27,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
 - Mastodon API: Fix private and direct statuses not being filtered out from the public timeline for an authenticated user (`GET /api/v1/timelines/public`)
 - Mastodon API: Inability to get some local users by nickname in `/api/v1/accounts/:id_or_nickname`
 - Added `:instance, extended_nickname_format` setting to the default config
+- Report emails now include functional links to profiles of remote user accounts
 
 ## [1.1.0] - 2019-??-??
 ### Security
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 31eac5f12b93f14dec818680d500ca6128a908d7..02c277a339803b75e533cf017d7e9d88a9037566 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]}