Rename make_unannounce_data helper to make_undo_data
authorFrancis Dinh <normandy@firemail.cc>
Sun, 22 Apr 2018 05:55:41 +0000 (01:55 -0400)
committerFrancis Dinh <normandy@firemail.cc>
Sun, 22 Apr 2018 05:55:41 +0000 (01:55 -0400)
This makes it a bit more easier to adapt for unlikes as well in the
future.

lib/pleroma/web/activity_pub/activity_pub.ex
lib/pleroma/web/activity_pub/utils.ex

index ace230804fb6a0e16071be2a36a34d1851a69752..0eb5829ef9f14e7b46f05290a676d3b83b5a2d78 100644 (file)
@@ -142,7 +142,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
 
   def unannounce(%User{} = actor, %Object{} = object, local \\ true) do
     with %Activity{} = activity <- get_existing_announce(actor.ap_id, object),
-         unannounce_data <- make_unannounce_data(actor, activity),
+         unannounce_data <- make_undo_data(actor, activity),
          {:ok, unannounce_activity} <- insert(unannounce_data, local),
          :ok <- maybe_federate(activity),
          {:ok, _activity} <- Repo.delete(activity),
index 9e2fa1fb22967875b0e8050b11e8f15854122462..d2a421ea4913f9bcb3ef677e8fc217458fb532bc 100644 (file)
@@ -279,9 +279,9 @@ defmodule Pleroma.Web.ActivityPub.Utils do
   end
 
   @doc """
-  Make unannounce activity data for the given actor and object
+  Make undo activity data for the given actor and object
   """
-  def make_unannounce_data(
+  def make_undo_data(
         %User{ap_id: ap_id} = user,
         %Activity{data: %{"id" => id, "context" => context}} = activity
       ) do