fix buggos
authorsadposter <hannah+pleroma@coffee-and-dreams.uk>
Sun, 12 Dec 2021 20:01:07 +0000 (20:01 +0000)
committersadposter <hannah+pleroma@coffee-and-dreams.uk>
Sun, 12 Dec 2021 20:01:07 +0000 (20:01 +0000)
lib/pleroma/elasticsearch/store.ex
lib/pleroma/web/activity_pub/side_effects.ex

index 17ba7199028ac5224b3aa859e6f54f706b79d077..f309bf7a5e484ca54652f0d30c8c159123383af9 100644 (file)
@@ -17,7 +17,7 @@ defmodule Pleroma.Elasticsearch do
     maybe_put_into_elasticsearch(activity)
   end
 
-  def maybe_put_into_elasticsearch(%{data: %{"type" => "Create"}, object: %{data: %{type: "Note"}}} = activity) do
+  def maybe_put_into_elasticsearch(%{data: %{"type" => "Create"}, object: %{data: %{"type" => "Note"}}} = activity) do
     if Config.get([:search, :provider]) == Pleroma.Search.Elasticsearch do
       actor = Pleroma.Activity.user_actor(activity)
 
index 19e833dec67fa65b48f6f123933a8669785eb953..91e9c72e03b408867cb3b3f995a6da57638f6aa0 100644 (file)
@@ -537,10 +537,18 @@ defmodule Pleroma.Web.ActivityPub.SideEffects do
   end
 
   @impl true
-  def handle_after_transaction(%{data: %{"type" => "Create"}} = activity) do
+  def handle_after_transaction(%Pleroma.Activity{data: %{"type" => "Create"}} = activity) do
     Pleroma.Elasticsearch.put_by_id(activity.id)
   end
 
+  def handle_after_transaction(%Pleroma.Activity{}) do
+    :ok
+  end
+
+  def handle_after_transaction(%Pleroma.Object{}) do
+    :ok
+  end
+
   def handle_after_transaction(meta) do
     meta
     |> send_notifications()