mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-10 10:09:02 +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
|
||||
|
||||
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
|
||||
|
||||
def get_by_nickname_or_email(nickname_or_email) do
|
||||
|
|
Loading…
Reference in a new issue