fix remote hashtags
[akkoma] / lib / pleroma / elasticsearch / store.ex
index 4789aebe016b78f88f7dcffd328c305af53fc69c..aa5e2b1040689e29944ac93255d0080cf1ba9d3e 100644 (file)
@@ -54,12 +54,6 @@ defmodule Pleroma.Elasticsearch do
         DocumentMappings.Activity.id(activity),
         DocumentMappings.Activity.encode(activity)
       )
-
-    {:ok, _} =
-      bulk_post(
-        activity.object.hashtags,
-        :hashtags
-      )
   end
 
   def put(%User{} = user) do
@@ -101,6 +95,12 @@ defmodule Pleroma.Elasticsearch do
       )
   end
 
+  def maybe_bulk_post(data, type) do
+    if enabled?() do
+      bulk_post(data, type)
+    end
+  end
+
   def bulk_post(data, :users) do
     d =
       data