Add option to return all friends in twitter api.
Mainly useful for user export.
This commit is contained in:
parent
1ce1b7b58d
commit
38e15930cb
2 changed files with 12 additions and 1 deletions
|
|
@ -524,6 +524,9 @@ defmodule Pleroma.Web.TwitterAPI.Controller do
|
|||
|
||||
def friends(%{assigns: %{user: for_user}} = conn, params) do
|
||||
{:ok, page} = Ecto.Type.cast(:integer, params["page"] || 1)
|
||||
{:ok, export} = Ecto.Type.cast(:boolean, params["all"] || false)
|
||||
|
||||
page = if export, do: nil, else: page
|
||||
|
||||
with {:ok, user} <- TwitterAPI.get_user(conn.assigns[:user], params),
|
||||
{:ok, friends} <- User.get_friends(user, page) do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue