fix bug in inbound
[akkoma] / lib / pleroma / web / common_api.ex
index 1b5f8491efa0ddff51ce3d7769f50ec208df3a5a..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
 
@@ -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}