Email-like field in /api/v1/accounts/verify_credentials response (for OAuth plugins like Peertube).
Addresses https://git.pleroma.social/pleroma/pleroma-support/-/issues/56.
This commit is contained in:
parent
7f07871639
commit
60b4654038
7 changed files with 49 additions and 7 deletions
|
|
@ -2030,6 +2030,15 @@ defmodule Pleroma.User do
|
|||
|> hd()
|
||||
end
|
||||
|
||||
def full_nickname(%User{} = user) do
|
||||
if String.contains?(user.nickname, "@") do
|
||||
user.nickname
|
||||
else
|
||||
%{host: host} = URI.parse(user.ap_id)
|
||||
user.nickname <> "@" <> host
|
||||
end
|
||||
end
|
||||
|
||||
def full_nickname(nickname_or_mention),
|
||||
do: String.trim_leading(nickname_or_mention, "@")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue