Skip to content
Snippets Groups Projects
Commit 44a65023 authored by lain's avatar lain
Browse files

MastoAPI: Remove domain ending from account name.

parent cda01285
Branches
No related tags found
No related merge requests found
......@@ -13,7 +13,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do
%{
id: user.id,
username: user.nickname,
username: hd(String.split(user.nickname, "@")),
acct: user.nickname,
display_name: user.name,
locked: false,
......@@ -34,7 +34,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do
%{
id: user.id,
acct: user.nickname,
username: user.nickname,
username: hd(String.split(user.nickname, "@")),
url: user.ap_id
}
end
......
......@@ -4,11 +4,11 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment