Merge branch 'develop' into feature/compat/push-subscriptions
[akkoma] / lib / pleroma / activity.ex
index 4f1f8292dc13408d99b7f5cf2c52195118e8e1a2..c065f3b6ce690a688ead5a087135f46e44f13ba8 100644 (file)
@@ -8,8 +8,6 @@ defmodule Pleroma.Activity do
     field(:local, :boolean, default: true)
     field(:actor, :string)
     field(:recipients, {:array, :string})
-    field(:recipients_to, {:array, :string})
-    field(:recipients_cc, {:array, :string})
     has_many(:notifications, Notification, on_delete: :delete_all)
 
     timestamps()
@@ -84,4 +82,10 @@ defmodule Pleroma.Activity do
   def normalize(obj) when is_map(obj), do: Activity.get_by_ap_id(obj["id"])
   def normalize(ap_id) when is_binary(ap_id), do: Activity.get_by_ap_id(ap_id)
   def normalize(_), do: nil
+
+  def get_in_reply_to_activity(%Activity{data: %{"object" => %{"inReplyTo" => ap_id}}}) do
+    get_create_activity_by_object_ap_id(ap_id)
+  end
+
+  def get_in_reply_to_activity(_), do: nil
 end