mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-11 03:39:13 +00:00
formatting
This commit is contained in:
parent
59518cbcd8
commit
a6973a668e
3 changed files with 10 additions and 7 deletions
|
@ -59,7 +59,8 @@ defmodule Pleroma.Activity do
|
|||
:inner,
|
||||
[activity],
|
||||
o in Object,
|
||||
on: fragment(
|
||||
on:
|
||||
fragment(
|
||||
"(?->>'id') = COALESCE((? -> 'object'::text) ->> 'id'::text)",
|
||||
o.data,
|
||||
activity.data
|
||||
|
|
|
@ -63,7 +63,8 @@ defmodule Pleroma.Web.CommonAPI do
|
|||
end
|
||||
|
||||
def delete(activity_id, user) do
|
||||
with %Activity{data: %{"object" => _}} = activity <- Activity.get_by_id_with_object(activity_id),
|
||||
with %Activity{data: %{"object" => _}} = activity <-
|
||||
Activity.get_by_id_with_object(activity_id),
|
||||
%Object{} = object <- Object.normalize(activity),
|
||||
true <- User.superuser?(user) || user.ap_id == object.data["actor"],
|
||||
{:ok, _} <- unpin(activity_id, user),
|
||||
|
|
|
@ -17,7 +17,8 @@ defmodule Pleroma.Web.CommonAPI.Utils do
|
|||
|
||||
# This is a hack for twidere.
|
||||
def get_by_id_or_ap_id(id) do
|
||||
activity = Activity.get_by_id_with_object(id) || Activity.get_create_by_object_ap_id_with_object(id)
|
||||
activity =
|
||||
Activity.get_by_id_with_object(id) || Activity.get_create_by_object_ap_id_with_object(id)
|
||||
|
||||
activity &&
|
||||
if activity.data["type"] == "Create" do
|
||||
|
|
Loading…
Reference in a new issue