Merge branch 'get_announce_visibility-name' into 'develop'

Rename misleading `get_announce_visibility` to `public_announce?`

See merge request pleroma/pleroma!1768
This commit is contained in:
kaniini 2019-10-02 10:44:51 +00:00
commit f205d3da1d
1 changed files with 3 additions and 3 deletions

View File

@ -80,7 +80,7 @@ def repeat(id_or_ap_id, user, params \\ %{}) 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 @@ defp normalize_and_validate_choices(choices, object) 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