%{
id: user.id,
- username: user.nickname,
+ username: hd(String.split(user.nickname, "@")),
acct: user.nickname,
display_name: user.name,
locked: false,
%{
id: user.id,
acct: user.nickname,
- username: user.nickname,
+ username: hd(String.split(user.nickname, "@")),
url: user.ap_id
}
end
alias Pleroma.Web.MastodonAPI.AccountView
test "Represent a user account" do
- user = insert(:user, %{info: %{"note_count" => 5, "follower_count" => 3}})
+ user = insert(:user, %{info: %{"note_count" => 5, "follower_count" => 3}, nickname: "shp@shitposter.club"})
expected = %{
id: user.id,
- username: user.nickname,
+ username: "shp",
acct: user.nickname,
display_name: user.name,
locked: false,