fixes
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
9e37ff9e62
commit
6926051040
7 changed files with 5 additions and 15 deletions
|
@ -113,7 +113,7 @@ defp increase_quotes_count_if_quote(_create_data), do: :noop
|
||||||
|
|
||||||
defp increase_hashtag_count(actor, %{object: %{hashtags: hashtags} = object})
|
defp increase_hashtag_count(actor, %{object: %{hashtags: hashtags} = object})
|
||||||
when is_list(hashtags) do
|
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)
|
Enum.each(hashtags, fn hashtag -> Pleroma.UserHashtag.increase_use_count(actor, hashtag) end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -98,7 +98,7 @@ defp rewrite_actor(object, user) do
|
||||||
|
|
||||||
defp strip_recipients(object, opts) do
|
defp strip_recipients(object, opts) do
|
||||||
keep_unlisted = opts[:keep_unlisted] || false
|
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 =
|
unlisted_ccs =
|
||||||
if keep_unlisted and orig_is_public do
|
if keep_unlisted and orig_is_public do
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
defmodule Pleroma.Web.ActivityPub.ObjectValidators.CommonFixes do
|
defmodule Pleroma.Web.ActivityPub.ObjectValidators.CommonFixes do
|
||||||
alias Pleroma.EctoType.ActivityPub.ObjectValidators
|
alias Pleroma.EctoType.ActivityPub.ObjectValidators
|
||||||
|
alias Pleroma.Language.LanguageDetector
|
||||||
alias Pleroma.Maps
|
alias Pleroma.Maps
|
||||||
alias Pleroma.Object
|
alias Pleroma.Object
|
||||||
alias Pleroma.Object.Containment
|
alias Pleroma.Object.Containment
|
||||||
|
|
|
@ -315,7 +315,7 @@ def handle(%{data: %{"type" => "Delete", "object" => deleted_object}} = object,
|
||||||
Object.decrease_quotes_count(quote_url)
|
Object.decrease_quotes_count(quote_url)
|
||||||
end
|
end
|
||||||
|
|
||||||
if Visibility.is_public?(deleted_object) do
|
if Visibility.public?(deleted_object) do
|
||||||
Enum.each(deleted_object.hashtags, fn hashtag ->
|
Enum.each(deleted_object.hashtags, fn hashtag ->
|
||||||
Pleroma.UserHashtag.decrease_use_count(user, hashtag)
|
Pleroma.UserHashtag.decrease_use_count(user, hashtag)
|
||||||
end)
|
end)
|
||||||
|
|
|
@ -8,7 +8,6 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|
||||||
"""
|
"""
|
||||||
alias Pleroma.Activity
|
alias Pleroma.Activity
|
||||||
alias Pleroma.EctoType.ActivityPub.ObjectValidators
|
alias Pleroma.EctoType.ActivityPub.ObjectValidators
|
||||||
alias Pleroma.Language.LanguageDetector
|
|
||||||
alias Pleroma.Maps
|
alias Pleroma.Maps
|
||||||
alias Pleroma.Object
|
alias Pleroma.Object
|
||||||
alias Pleroma.Object.Containment
|
alias Pleroma.Object.Containment
|
||||||
|
|
|
@ -13,7 +13,6 @@ defmodule Pleroma.Web.MastodonAPI.StatusController do
|
||||||
alias Pleroma.Activity
|
alias Pleroma.Activity
|
||||||
alias Pleroma.Bookmark
|
alias Pleroma.Bookmark
|
||||||
alias Pleroma.BookmarkFolder
|
alias Pleroma.BookmarkFolder
|
||||||
alias Pleroma.Language.Translation
|
|
||||||
alias Pleroma.Object
|
alias Pleroma.Object
|
||||||
alias Pleroma.Repo
|
alias Pleroma.Repo
|
||||||
alias Pleroma.ScheduledActivity
|
alias Pleroma.ScheduledActivity
|
||||||
|
@ -641,7 +640,7 @@ def translate_many(
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
defp translate_one(status_id, language, user \\ nil) do
|
defp translate_one(status_id, language, user) do
|
||||||
with {:authentication, true} <-
|
with {:authentication, true} <-
|
||||||
{:authentication,
|
{:authentication,
|
||||||
!is_nil(user) ||
|
!is_nil(user) ||
|
||||||
|
|
|
@ -331,15 +331,6 @@ defmodule Pleroma.Web.Router do
|
||||||
get("/announcements/:id", AnnouncementController, :show)
|
get("/announcements/:id", AnnouncementController, :show)
|
||||||
patch("/announcements/:id", AnnouncementController, :change)
|
patch("/announcements/:id", AnnouncementController, :change)
|
||||||
delete("/announcements/:id", AnnouncementController, :delete)
|
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
|
end
|
||||||
|
|
||||||
# AdminAPI: admins and mods (staff) can perform these actions (if privileged by role)
|
# AdminAPI: admins and mods (staff) can perform these actions (if privileged by role)
|
||||||
|
|
Loading…
Reference in a new issue