has_many(:outgoing_relationships, UserRelationship, foreign_key: :source_id)
has_many(:incoming_relationships, UserRelationship, foreign_key: :target_id)
+ has_many(:frontend_profiles, Pleroma.Akkoma.FrontendSettingsProfile)
+
for {relationship_type,
[
{outgoing_relation, outgoing_relation_target},
{%User{} = user, _} ->
{:ok, user}
- _ ->
+ e ->
+ Logger.error("Could not fetch user, #{inspect(e)}")
{:error, :not_found}
end
end
@doc "Gets or fetch a user by uri or nickname."
@spec get_or_fetch(String.t()) :: {:ok, User.t()} | {:error, String.t()}
- def get_or_fetch("http" <> _host = uri), do: get_or_fetch_by_ap_id(uri)
+ def get_or_fetch("http://" <> _host = uri), do: get_or_fetch_by_ap_id(uri)
+ def get_or_fetch("https://" <> _host = uri), do: get_or_fetch_by_ap_id(uri)
def get_or_fetch(nickname), do: get_or_fetch_by_nickname(nickname)
# wait a period of time and return newest version of the User structs