Remove unused functions and fix credo issues
This commit is contained in:
parent
ce23529d91
commit
fb96facc32
|
@ -7,9 +7,9 @@ defmodule Pleroma.Delivery do
|
||||||
|
|
||||||
alias Pleroma.Delivery
|
alias Pleroma.Delivery
|
||||||
alias Pleroma.FlakeId
|
alias Pleroma.FlakeId
|
||||||
alias Pleroma.User
|
|
||||||
alias Pleroma.Repo
|
|
||||||
alias Pleroma.Object
|
alias Pleroma.Object
|
||||||
|
alias Pleroma.Repo
|
||||||
|
alias Pleroma.User
|
||||||
alias Pleroma.User
|
alias Pleroma.User
|
||||||
|
|
||||||
import Ecto.Changeset
|
import Ecto.Changeset
|
||||||
|
@ -39,13 +39,6 @@ def get(object_id, user_id) do
|
||||||
|> Repo.one()
|
|> Repo.one()
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_or_create(object_id, user_id) do
|
|
||||||
case get(object_id, user_id) do
|
|
||||||
%Delivery{} = delivery -> {:ok, delivery}
|
|
||||||
nil -> create(object_id, user_id)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# A hack because user delete activities have a fake id for whatever reason
|
# A hack because user delete activities have a fake id for whatever reason
|
||||||
# TODO: Get rid of this
|
# TODO: Get rid of this
|
||||||
def delete_all_by_object_id("pleroma:fake_object_id"), do: {0, []}
|
def delete_all_by_object_id("pleroma:fake_object_id"), do: {0, []}
|
||||||
|
@ -54,9 +47,4 @@ def delete_all_by_object_id(object_id) do
|
||||||
from(d in Delivery, where: d.object_id == ^object_id)
|
from(d in Delivery, where: d.object_id == ^object_id)
|
||||||
|> Repo.delete_all()
|
|> Repo.delete_all()
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_all_by_object_id(object_id) do
|
|
||||||
from(d in Delivery, where: d.object_id == ^object_id)
|
|
||||||
|> Repo.all()
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -8,8 +8,8 @@ defmodule Pleroma.Web.ActivityPub.Publisher do
|
||||||
alias Pleroma.Delivery
|
alias Pleroma.Delivery
|
||||||
alias Pleroma.HTTP
|
alias Pleroma.HTTP
|
||||||
alias Pleroma.Instances
|
alias Pleroma.Instances
|
||||||
alias Pleroma.User
|
|
||||||
alias Pleroma.Object
|
alias Pleroma.Object
|
||||||
|
alias Pleroma.User
|
||||||
alias Pleroma.Web.ActivityPub.Relay
|
alias Pleroma.Web.ActivityPub.Relay
|
||||||
alias Pleroma.Web.ActivityPub.Transmogrifier
|
alias Pleroma.Web.ActivityPub.Transmogrifier
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,8 @@ defmodule Pleroma.Web.ActivityPub.PublisherTest do
|
||||||
import Mock
|
import Mock
|
||||||
|
|
||||||
alias Pleroma.Activity
|
alias Pleroma.Activity
|
||||||
alias Pleroma.Object
|
|
||||||
alias Pleroma.Instances
|
alias Pleroma.Instances
|
||||||
|
alias Pleroma.Object
|
||||||
alias Pleroma.Web.ActivityPub.Publisher
|
alias Pleroma.Web.ActivityPub.Publisher
|
||||||
alias Pleroma.Web.CommonAPI
|
alias Pleroma.Web.CommonAPI
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue