aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorhakabahitoyo <hakabahitoyo@example.com>2018-07-14 11:41:09 +0900
committerhakabahitoyo <hakabahitoyo@example.com>2018-07-14 11:41:09 +0900
commit127882a5d51d8243eae44ad7ed73bf6010804760 (patch)
tree55d5b37b3867ae2eb260d047b4c0fa6ed987ad73 /lib
parenteb0afda3a72aa08a991e25b05c98ae798655f413 (diff)
downloadpleroma-127882a5d51d8243eae44ad7ed73bf6010804760.tar.gz
configurable
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/mastodon_api/mastodon_api_controller.ex4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
index 4f48a141b..fd60db3d6 100644
--- a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
+++ b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
@@ -1073,10 +1073,12 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
|> json("Something went wrong")
end
+ @suggestions Application.get_env(:pleroma, :suggestions)
+
def suggestions(%{assigns: %{user: user}} = conn, _) do
host = String.replace Web.base_url(), "https://", ""
user = user.nickname
- api = "http://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-filtered-api.cgi?{{host}}+{{user}}"
+ api = Keyword.get(@suggestions, :third_party_engine, "")
url = String.replace(api, "{{host}}", host) |> String.replace("{{user}}", user)
with {:ok, %{status_code: 200, body: body}} <-
@httpoison.get(url),