run mix format
authorWilliam Pitcock <nenolod@dereferenced.org>
Mon, 28 May 2018 18:31:48 +0000 (18:31 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Mon, 11 Jun 2018 22:15:53 +0000 (22:15 +0000)
lib/pleroma/user.ex
lib/pleroma/web/activity_pub/transmogrifier.ex
lib/pleroma/web/activity_pub/utils.ex

index 1dcb68470d92adda90ad42a3f86652037e2dc932..b27397e13956fc5ae16e638ff3e2ef69c1e21d2b 100644 (file)
@@ -364,19 +364,22 @@ defmodule Pleroma.User do
   def get_follow_requests_query(%User{} = user) do
     from(
       a in Activity,
-      where: fragment(
-        "? ->> 'type' = 'Follow'",
-        a.data
-      ),
-      where: fragment(
-        "? ->> 'state' = 'pending'",
-        a.data
-      ),
-      where: fragment(
-        "? @> ?",
-        a.data,
-        ^%{"object" => user.ap_id}
-      )
+      where:
+        fragment(
+          "? ->> 'type' = 'Follow'",
+          a.data
+        ),
+      where:
+        fragment(
+          "? ->> 'state' = 'pending'",
+          a.data
+        ),
+      where:
+        fragment(
+          "? @> ?",
+          a.data,
+          ^%{"object" => user.ap_id}
+        )
     )
   end
 
@@ -385,9 +388,9 @@ defmodule Pleroma.User do
     reqs = Repo.all(q)
 
     users =
-      Enum.map(reqs, fn (req) -> req.actor end)
-      |> Enum.uniq
-      |> Enum.map(fn (ap_id) -> get_by_ap_id(ap_id) end)
+      Enum.map(reqs, fn req -> req.actor end)
+      |> Enum.uniq()
+      |> Enum.map(fn ap_id -> get_by_ap_id(ap_id) end)
 
     {:ok, users}
   end
index dffe2f1596684040bb4e29e458adbbd29beca32f..08173f78db161671d947a7e5a787ff7283563c81 100644 (file)
@@ -138,7 +138,13 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
          %User{} = follower <- User.get_or_fetch_by_ap_id(follower),
          {:ok, activity} <- ActivityPub.follow(follower, followed, id, false) do
       if not User.locked?(followed) do
-        ActivityPub.accept(%{to: [follower.ap_id], actor: followed.ap_id, object: data, local: true})
+        ActivityPub.accept(%{
+          to: [follower.ap_id],
+          actor: followed.ap_id,
+          object: data,
+          local: true
+        })
+
         User.follow(follower, followed)
       end
 
index 6ce954cd0597c93dc6c05c8480fb68812bac754c..64329b710080362bbf6b4c30e8903e8efda00ff0 100644 (file)
@@ -233,7 +233,11 @@ defmodule Pleroma.Web.ActivityPub.Utils do
   @doc """
   Makes a follow activity data for the given follower and followed
   """
-  def make_follow_data(%User{ap_id: follower_id}, %User{ap_id: followed_id} = followed, activity_id) do
+  def make_follow_data(
+        %User{ap_id: follower_id},
+        %User{ap_id: followed_id} = followed,
+        activity_id
+      ) do
     data = %{
       "type" => "Follow",
       "actor" => follower_id,