mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 00:26:30 +00:00
Pleroma.Web.ActivityPub.SideEffects: dialyzer errors
lib/pleroma/web/activity_pub/side_effects.ex:328:pattern_match The pattern can never match the type. Pattern: {:actor, _} Type: {:error, boolean()} lib/pleroma/web/activity_pub/side_effects.ex:328:pattern_match The pattern can never match the type. Pattern: {:actor, _} Type: nil
This commit is contained in:
parent
94d7e28cbe
commit
5f5bd64b83
1 changed files with 13 additions and 2 deletions
|
@ -304,9 +304,9 @@ defmodule Pleroma.Web.ActivityPub.SideEffects do
|
|||
result =
|
||||
case deleted_object do
|
||||
%Object{} ->
|
||||
with {:ok, deleted_object, _activity} <- Object.delete(deleted_object),
|
||||
with {_, {:ok, deleted_object, _activity}} <- {:object, Object.delete(deleted_object)},
|
||||
{_, actor} when is_binary(actor) <- {:actor, deleted_object.data["actor"]},
|
||||
%User{} = user <- User.get_cached_by_ap_id(actor) do
|
||||
{_, %User{} = user} <- {:user, User.get_cached_by_ap_id(actor)} do
|
||||
User.remove_pinned_object_id(user, deleted_object.data["id"])
|
||||
|
||||
{:ok, user} = ActivityPub.decrease_note_count_if_public(user, deleted_object)
|
||||
|
@ -328,6 +328,17 @@ defmodule Pleroma.Web.ActivityPub.SideEffects do
|
|||
{:actor, _} ->
|
||||
@logger.error("The object doesn't have an actor: #{inspect(deleted_object)}")
|
||||
:no_object_actor
|
||||
|
||||
{:user, _} ->
|
||||
@logger.error(
|
||||
"The object's actor could not be resolved to a user: #{inspect(deleted_object)}"
|
||||
)
|
||||
|
||||
:no_object_user
|
||||
|
||||
{:object, _} ->
|
||||
@logger.error("The object could not be deleted: #{inspect(deleted_object)}")
|
||||
{:error, object}
|
||||
end
|
||||
|
||||
%User{} ->
|
||||
|
|
Loading…
Reference in a new issue