fix buggos

This commit is contained in:
sadposter 2021-12-12 20:01:07 +00:00 committed by FloatingGhost
parent fe313522b2
commit ee82cb7ae9
2 changed files with 10 additions and 2 deletions

View file

@ -17,7 +17,7 @@ def maybe_put_into_elasticsearch({:ok, activity}) do
maybe_put_into_elasticsearch(activity) maybe_put_into_elasticsearch(activity)
end 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 if Config.get([:search, :provider]) == Pleroma.Search.Elasticsearch do
actor = Pleroma.Activity.user_actor(activity) actor = Pleroma.Activity.user_actor(activity)

View file

@ -537,10 +537,18 @@ defp add_notifications(meta, notifications) do
end end
@impl true @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) Pleroma.Elasticsearch.put_by_id(activity.id)
end 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 def handle_after_transaction(meta) do
meta meta
|> send_notifications() |> send_notifications()