Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2024-03-23 15:27:52 +01:00
parent 9e37ff9e62
commit 6926051040
7 changed files with 5 additions and 15 deletions

View file

@ -113,7 +113,7 @@ defp increase_quotes_count_if_quote(_create_data), do: :noop
defp increase_hashtag_count(actor, %{object: %{hashtags: hashtags} = object})
when is_list(hashtags) do
if is_public?(object) do
if public?(object) do
Enum.each(hashtags, fn hashtag -> Pleroma.UserHashtag.increase_use_count(actor, hashtag) end)
end
end

View file

@ -98,7 +98,7 @@ defp rewrite_actor(object, user) do
defp strip_recipients(object, opts) do
keep_unlisted = opts[:keep_unlisted] || false
orig_is_public = Visibility.is_public?(object) and not Visibility.is_local_public?(object)
orig_is_public = Visibility.public?(object) and not Visibility.local_public?(object)
unlisted_ccs =
if keep_unlisted and orig_is_public do

View file

@ -4,6 +4,7 @@
defmodule Pleroma.Web.ActivityPub.ObjectValidators.CommonFixes do
alias Pleroma.EctoType.ActivityPub.ObjectValidators
alias Pleroma.Language.LanguageDetector
alias Pleroma.Maps
alias Pleroma.Object
alias Pleroma.Object.Containment

View file

@ -315,7 +315,7 @@ def handle(%{data: %{"type" => "Delete", "object" => deleted_object}} = object,
Object.decrease_quotes_count(quote_url)
end
if Visibility.is_public?(deleted_object) do
if Visibility.public?(deleted_object) do
Enum.each(deleted_object.hashtags, fn hashtag ->
Pleroma.UserHashtag.decrease_use_count(user, hashtag)
end)

View file

@ -8,7 +8,6 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
"""
alias Pleroma.Activity
alias Pleroma.EctoType.ActivityPub.ObjectValidators
alias Pleroma.Language.LanguageDetector
alias Pleroma.Maps
alias Pleroma.Object
alias Pleroma.Object.Containment

View file

@ -13,7 +13,6 @@ defmodule Pleroma.Web.MastodonAPI.StatusController do
alias Pleroma.Activity
alias Pleroma.Bookmark
alias Pleroma.BookmarkFolder
alias Pleroma.Language.Translation
alias Pleroma.Object
alias Pleroma.Repo
alias Pleroma.ScheduledActivity
@ -641,7 +640,7 @@ def translate_many(
end
end
defp translate_one(status_id, language, user \\ nil) do
defp translate_one(status_id, language, user) do
with {:authentication, true} <-
{:authentication,
!is_nil(user) ||

View file

@ -331,15 +331,6 @@ defmodule Pleroma.Web.Router do
get("/announcements/:id", AnnouncementController, :show)
patch("/announcements/:id", AnnouncementController, :change)
delete("/announcements/:id", AnnouncementController, :delete)
get("/webhooks", WebhookController, :index)
get("/webhooks/:id", WebhookController, :show)
post("/webhooks", WebhookController, :create)
patch("/webhooks/:id", WebhookController, :update)
delete("/webhooks/:id", WebhookController, :delete)
post("/webhooks/:id/enable", WebhookController, :enable)
post("/webhooks/:id/disable", WebhookController, :disable)
post("/webhooks/:id/rotate_secret", WebhookController, :rotate_secret)
end
# AdminAPI: admins and mods (staff) can perform these actions (if privileged by role)