X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Fcommon_api.ex;h=3266b1c607017676a00dcb8dd2d45969b8e74a46;hb=3252ed0f544bf5e1cc6d3e09bfa1a4866889ec91;hp=1b5f8491efa0ddff51ce3d7769f50ec208df3a5a;hpb=efed94a23e30260bcf1b297910906b11d6e4d895;p=akkoma diff --git a/lib/pleroma/web/common_api.ex b/lib/pleroma/web/common_api.ex index 1b5f8491e..3266b1c60 100644 --- a/lib/pleroma/web/common_api.ex +++ b/lib/pleroma/web/common_api.ex @@ -397,7 +397,13 @@ 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 +493,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}