From: Roger Braun Date: Fri, 12 May 2017 16:58:25 +0000 (+0200) Subject: On user making, check if we have a user with that uri. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=d95ac274d62ce86c2a1d0a9d553dbdd130e6ab49;p=akkoma On user making, check if we have a user with that uri. --- diff --git a/lib/pleroma/web/ostatus/ostatus.ex b/lib/pleroma/web/ostatus/ostatus.ex index 1ac38bd8a..05bc4058c 100644 --- a/lib/pleroma/web/ostatus/ostatus.ex +++ b/lib/pleroma/web/ostatus/ostatus.ex @@ -235,8 +235,12 @@ defmodule Pleroma.Web.OStatus do info: info, avatar: info["avatar"] } - cs = User.remote_user_creation(data) - Repo.insert(cs) + with %User{} = user <- User.get_by_ap_id(data.ap_id) do + {:ok, user} + else _e -> + cs = User.remote_user_creation(data) + Repo.insert(cs) + end end end