Rename misleading `get_announce_visibility` to `public_announce?`
authorThibaut Girka <thib@sitedethib.com>
Wed, 2 Oct 2019 08:48:34 +0000 (10:48 +0200)
committerThibaut Girka <thib@sitedethib.com>
Wed, 2 Oct 2019 08:48:34 +0000 (10:48 +0200)
lib/pleroma/web/common_api/common_api.ex

index 677a53ddfb8a37471d7d8245c25f8e8619b51cbf..ce73b3270841d3a29a20103b70c4a893ec4a852c 100644 (file)
@@ -80,7 +80,7 @@ defmodule Pleroma.Web.CommonAPI do
     with %Activity{} = activity <- get_by_id_or_ap_id(id_or_ap_id),
          object <- Object.normalize(activity),
          nil <- Utils.get_existing_announce(user.ap_id, object),
-         public <- get_announce_visibility(object, params) do
+         public <- public_announce?(object, params) do
       ActivityPub.announce(user, object, nil, true, public)
     else
       _ -> {:error, dgettext("errors", "Could not repeat")}
@@ -170,11 +170,11 @@ defmodule Pleroma.Web.CommonAPI do
     end
   end
 
-  def get_announce_visibility(_, %{"visibility" => visibility})
+  def public_announce?(_, %{"visibility" => visibility})
       when visibility in ~w{public unlisted private direct},
       do: visibility in ~w(public unlisted)
 
-  def get_announce_visibility(object, _) do
+  def public_announce?(object, _) do
     Visibility.is_public?(object)
   end