fix bug in inbound
[akkoma] / lib / pleroma / web / common_api.ex
index 6f685cb7ba570b117d768f34f79a1d1be8441e6c..f6a131c21bc4d2fc2b014b4597484da81cf43607 100644 (file)
@@ -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