formatting
authorWilliam Pitcock <nenolod@dereferenced.org>
Sat, 23 Mar 2019 00:28:16 +0000 (00:28 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Sat, 23 Mar 2019 00:28:16 +0000 (00:28 +0000)
lib/pleroma/activity.ex
lib/pleroma/web/common_api/common_api.ex
lib/pleroma/web/common_api/utils.ex

index f041d0e5364211698baf52ccd4c59af09fc5c3db..a762d66ef7a4764120da793f56e7893dba8bc1aa 100644 (file)
@@ -59,11 +59,12 @@ defmodule Pleroma.Activity do
       :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
index 8625f6621fc32c7990e426c814e9f223a6d9c263..25b99067775770d42fdd5c068180e8a526f4e6c4 100644 (file)
@@ -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),
index 6a94c2d26dc301bcf5138602a64d516cc3431e65..f596f703b5f3bae9bc8de8894372760407da4d1b 100644 (file)
@@ -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