:inner,
[activity],
o in Object,
- on: fragment(
- "(?->>'id') = COALESCE((? -> 'object'::text) ->> 'id'::text)",
- o.data,
- activity.data
- )
+ on:
+ fragment(
+ "(?->>'id') = COALESCE((? -> 'object'::text) ->> 'id'::text)",
+ o.data,
+ activity.data
+ )
)
|> preload([activity, object], object: object)
end
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),
# 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