Use all the available fields in the user export

This commit is contained in:
Mark Felder 2022-11-28 09:11:18 -05:00
parent 53b1b1a529
commit 4ceb92ec09

View file

@ -15,9 +15,22 @@ defmodule Pleroma.Web.PleromaAPI.UserExportController do
@following_accounts_header "Account address,Show boosts,Notify on new posts,Languages\n"
def following(%{assigns: %{user: follower}} = conn, _) do
friends = User.get_friends_nicknames(follower) |> Enum.join(",true,false,\n")
data =
follower
|> User.get_friends_nicknames()
|> Enum.map(fn follow ->
[
follow,
!User.muting_reblogs?(follower, follow),
!User.subscribed_to?(follower, follow),
nil
]
|> Enum.map(&Kernel.to_string(&1))
|> Enum.join(",")
end)
|> Enum.join("\n")
csv_data = @following_accounts_header <> friends <> ",true,false,"
csv_data = @following_accounts_header <> data
conn
|> put_resp_content_type("text/csv")