From d95ac274d62ce86c2a1d0a9d553dbdd130e6ab49 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Fri, 12 May 2017 18:58:25 +0200 Subject: [PATCH] On user making, check if we have a user with that uri. --- lib/pleroma/web/ostatus/ostatus.ex | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 -- 2.45.2