mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-22 22:49:25 +00:00
[#483] User.get_by_nickname/1: allowed retrieving user by fully-qualified local nickname
(<nick>@<our_instance_host>).
This commit is contained in:
parent
67b4297f4d
commit
b3574dccbb
|
@ -387,7 +387,11 @@ defmodule Pleroma.User do
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_by_nickname(nickname) do
|
def get_by_nickname(nickname) do
|
||||||
Repo.get_by(User, nickname: nickname)
|
Repo.get_by(User, nickname: nickname) ||
|
||||||
|
if String.ends_with?(nickname, "@" <> Pleroma.Web.Endpoint.host()) do
|
||||||
|
[local_nickname, _] = String.split(nickname, "@")
|
||||||
|
Repo.get_by(User, nickname: local_nickname)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_by_nickname_or_email(nickname_or_email) do
|
def get_by_nickname_or_email(nickname_or_email) do
|
||||||
|
|
Loading…
Reference in a new issue