On user making, check if we have a user with that uri.
This commit is contained in:
parent
04544da8f1
commit
d95ac274d6
|
@ -235,10 +235,14 @@ def make_user(uri) do
|
||||||
info: info,
|
info: info,
|
||||||
avatar: info["avatar"]
|
avatar: info["avatar"]
|
||||||
}
|
}
|
||||||
|
with %User{} = user <- User.get_by_ap_id(data.ap_id) do
|
||||||
|
{:ok, user}
|
||||||
|
else _e ->
|
||||||
cs = User.remote_user_creation(data)
|
cs = User.remote_user_creation(data)
|
||||||
Repo.insert(cs)
|
Repo.insert(cs)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# TODO: Just takes the first one for now.
|
# TODO: Just takes the first one for now.
|
||||||
def make_avatar_object(author_doc) do
|
def make_avatar_object(author_doc) do
|
||||||
|
|
Loading…
Reference in New Issue