2020-06-03 17:40:48 +00:00
|
|
|
# Pleroma: A lightweight social networking server
|
|
|
|
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
defmodule Pleroma.Web.Preload.Providers.StatusNet do
|
|
|
|
alias Pleroma.Web.Preload.Providers.Provider
|
2020-06-26 12:47:38 +00:00
|
|
|
alias Pleroma.Web.TwitterAPI.UtilController
|
2020-06-03 17:40:48 +00:00
|
|
|
|
|
|
|
@behaviour Provider
|
2020-06-29 09:41:00 +00:00
|
|
|
@config_url "/api/statusnet/config.json"
|
2020-06-03 17:40:48 +00:00
|
|
|
|
|
|
|
@impl Provider
|
|
|
|
def generate_terms(_params) do
|
|
|
|
%{}
|
|
|
|
|> build_config_tag()
|
|
|
|
end
|
|
|
|
|
|
|
|
defp build_config_tag(acc) do
|
2020-06-26 12:47:38 +00:00
|
|
|
resp =
|
|
|
|
Plug.Test.conn(:get, @config_url |> to_string())
|
|
|
|
|> UtilController.config(nil)
|
2020-06-03 17:40:48 +00:00
|
|
|
|
2020-06-26 12:47:38 +00:00
|
|
|
Map.put(acc, @config_url, resp.resp_body)
|
2020-06-03 17:40:48 +00:00
|
|
|
end
|
|
|
|
end
|