Remove useless with clause
authorrinpatch <rinpatch@sdf.org>
Wed, 25 Sep 2019 13:26:47 +0000 (16:26 +0300)
committerrinpatch <rinpatch@sdf.org>
Thu, 26 Sep 2019 00:46:17 +0000 (03:46 +0300)
lib/pleroma/web/activity_pub/activity_pub_controller.ex

index 5a3a4d5d1f661b3aead01303567af2c7e73b7fda..80f3b4e0c52239562b15b712915b276d157a6cd0 100644 (file)
@@ -312,23 +312,23 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubController do
         %{"nickname" => nickname, "page" => page?} = params
       )
       when page? in [true, "true"] do
-    with activities <-
-           (if params["max_id"] do
-              ActivityPub.fetch_activities([user.ap_id | user.following], %{
-                "max_id" => params["max_id"],
-                "limit" => 10
-              })
-            else
-              ActivityPub.fetch_activities([user.ap_id | user.following], %{"limit" => 10})
-            end) do
-      conn
-      |> put_resp_content_type("application/activity+json")
-      |> put_view(UserView)
-      |> render("activity_collection_page.json", %{
-        activities: activities,
-        iri: "#{user.ap_id}/inbox"
-      })
-    end
+    activities =
+      if params["max_id"] do
+        ActivityPub.fetch_activities([user.ap_id | user.following], %{
+          "max_id" => params["max_id"],
+          "limit" => 10
+        })
+      else
+        ActivityPub.fetch_activities([user.ap_id | user.following], %{"limit" => 10})
+      end
+
+    conn
+    |> put_resp_content_type("application/activity+json")
+    |> put_view(UserView)
+    |> render("activity_collection_page.json", %{
+      activities: activities,
+      iri: "#{user.ap_id}/inbox"
+    })
   end
 
   def read_inbox(%{assigns: %{user: %{nickname: nickname} = user}} = conn, %{