Remove unused functions and fix credo issues

This commit is contained in:
rinpatch 2019-09-13 12:06:31 +03:00
parent ce23529d91
commit fb96facc32
3 changed files with 4 additions and 16 deletions

View File

@ -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

View File

@ -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

View File

@ -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