Emoji: Update to Unicode 13.1, switch base file, allow multichar.
[akkoma] / lib / pleroma / activity.ex
index 553834da0b786f905f1544fc9feb395c66bc0285..8559ae6a97a388dd5356b3d1869310156f2b65ee 100644 (file)
@@ -356,4 +356,15 @@ defmodule Pleroma.Activity do
     actor = user_actor(activity)
     activity.id in actor.pinned_activities
   end
+
+  @spec get_by_object_ap_id_with_object(String.t()) :: t() | nil
+  def get_by_object_ap_id_with_object(ap_id) when is_binary(ap_id) do
+    ap_id
+    |> Queries.by_object_id()
+    |> with_preloaded_object()
+    |> first()
+    |> Repo.one()
+  end
+
+  def get_by_object_ap_id_with_object(_), do: nil
 end