X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Fcommon_api.ex;h=f6a131c21bc4d2fc2b014b4597484da81cf43607;hb=f341e686221598612670c712f754f44cf4e9baed;hp=1b5f8491efa0ddff51ce3d7769f50ec208df3a5a;hpb=e2ba852bfe8e1fa0cf25463e57185ba9cfabf429;p=akkoma diff --git a/lib/pleroma/web/common_api.ex b/lib/pleroma/web/common_api.ex index 1b5f8491e..f6a131c21 100644 --- a/lib/pleroma/web/common_api.ex +++ b/lib/pleroma/web/common_api.ex @@ -397,7 +397,11 @@ defmodule Pleroma.Web.CommonAPI do def post(user, %{status: _} = data) do with {:ok, draft} <- ActivityDraft.create(user, data) do - ActivityPub.create(draft.changes, draft.preview?) + activity = ActivityPub.create(draft.changes, draft.preview?) + unless draft.preview? do + Pleroma.Elasticsearch.maybe_put_into_elasticsearch(activity) + end + activity end end @@ -487,9 +491,7 @@ defmodule Pleroma.Web.CommonAPI do else {what, result} = error -> Logger.warn( - "CommonAPI.remove_mute/2 failed. #{what}: #{result}, user_id: #{user_id}, activity_id: #{ - activity_id - }" + "CommonAPI.remove_mute/2 failed. #{what}: #{result}, user_id: #{user_id}, activity_id: #{activity_id}" ) {:error, error}