Merge branch 'develop' into feature/1885-MRF-metadata
[akkoma] / lib / pleroma / web / preload / status_net.ex
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Web.Preload.Providers.StatusNet do
6 alias Pleroma.Web.Preload.Providers.Provider
7 alias Pleroma.Web.TwitterAPI.UtilController
8
9 @behaviour Provider
10 @config_url "/api/statusnet/config.json"
11
12 @impl Provider
13 def generate_terms(_params) do
14 %{}
15 |> build_config_tag()
16 end
17
18 defp build_config_tag(acc) do
19 resp =
20 Plug.Test.conn(:get, @config_url |> to_string())
21 |> UtilController.config(nil)
22
23 Map.put(acc, @config_url, resp.resp_body)
24 end
25 end