From 3d61efa7c99e1ee9626bf77b3866cfc1562c663b Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Wed, 2 Oct 2019 10:48:34 +0200 Subject: [PATCH] Rename misleading `get_announce_visibility` to `public_announce?` --- lib/pleroma/web/common_api/common_api.ex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pleroma/web/common_api/common_api.ex b/lib/pleroma/web/common_api/common_api.ex index 677a53ddf..ce73b3270 100644 --- a/lib/pleroma/web/common_api/common_api.ex +++ b/lib/pleroma/web/common_api/common_api.ex @@ -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 -- 2.45.2