User.get_domain/1 --> User.get_host/1
This commit is contained in:
parent
ffa17fa383
commit
f807eb1e94
@ -2294,7 +2294,7 @@ defmodule Pleroma.User do
|
|||||||
|> Map.put(:fields, fields)
|
|> Map.put(:fields, fields)
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_domain(%User{ap_id: ap_id} = _user) do
|
def get_host(%User{ap_id: ap_id} = _user) do
|
||||||
URI.parse(ap_id).host
|
URI.parse(ap_id).host
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<div class="account-header__avatar" style="background-image: url('<%= Pleroma.User.avatar_url(@user) %>')"></div>
|
<div class="account-header__avatar" style="background-image: url('<%= Pleroma.User.avatar_url(@user) %>')"></div>
|
||||||
<div class="account-header__meta">
|
<div class="account-header__meta">
|
||||||
<div class="account-header__display-name"><%= @user.name %></div>
|
<div class="account-header__display-name"><%= @user.name %></div>
|
||||||
<div class="account-header__nickname">@<%= @user.nickname %>@<%= Pleroma.User.get_domain(@user) %></div>
|
<div class="account-header__nickname">@<%= @user.nickname %>@<%= Pleroma.User.get_host(@user) %></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -1886,8 +1886,8 @@ defmodule Pleroma.UserTest do
|
|||||||
assert User.avatar_url(user, no_default: true) == nil
|
assert User.avatar_url(user, no_default: true) == nil
|
||||||
end
|
end
|
||||||
|
|
||||||
test "get_domain/1" do
|
test "get_host/1" do
|
||||||
user = insert(:user, ap_id: "https://lain.com/users/lain", nickname: "lain")
|
user = insert(:user, ap_id: "https://lain.com/users/lain", nickname: "lain")
|
||||||
assert User.get_domain(user) == "lain.com"
|
assert User.get_host(user) == "lain.com"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user