Merge branch 'feat/expose_email_to_self' into 'develop'

Expose user email address to user/owner; not publicly.

See merge request pleroma/pleroma!3412
This commit is contained in:
Haelwenn 2021-05-26 18:04:23 +00:00
commit f34e22bba2
3 changed files with 29 additions and 0 deletions

View file

@ -468,6 +468,23 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
%{user: user, for: user}
)[:pleroma][:unread_notifications_count] == 7
end
test "shows email only to the account owner" do
user = insert(:user)
other_user = insert(:user)
user = User.get_cached_by_ap_id(user.ap_id)
assert AccountView.render(
"show.json",
%{user: user, for: other_user}
)[:pleroma][:email] == nil
assert AccountView.render(
"show.json",
%{user: user, for: user}
)[:pleroma][:email] == user.email
end
end
describe "follow requests counter" do