diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/pleroma/web/endpoint.ex | 3 | ||||
| -rw-r--r-- | lib/pleroma/web/mastodon_api/mastodon_api_controller.ex | 6 | 
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/pleroma/web/endpoint.ex b/lib/pleroma/web/endpoint.ex index 0a2ac853e..dde4e3ffe 100644 --- a/lib/pleroma/web/endpoint.ex +++ b/lib/pleroma/web/endpoint.ex @@ -34,7 +34,8 @@ defmodule Pleroma.Web.Endpoint do      Plug.Parsers,      parsers: [:urlencoded, :multipart, :json],      pass: ["*/*"], -    json_decoder: Jason +    json_decoder: Jason, +    length: Application.get_env(:pleroma, :instance) |> Keyword.get(:upload_limit)    )    plug(Plug.MethodOverride) diff --git a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex index 58bb5e03a..dc92e30c5 100644 --- a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex +++ b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex @@ -513,12 +513,16 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do        )      statuses = Repo.all(q) ++ fetched +    tags = String.split(query) +    |> Enum.uniq() +    |> Enum.filter(fn tag -> String.starts_with?(tag, "#") end) +    |> Enum.map(fn tag -> String.slice(tag, 1..-1) end)      res = %{        "accounts" => AccountView.render("accounts.json", users: accounts, for: user, as: :user),        "statuses" =>          StatusView.render("index.json", activities: statuses, for: user, as: :activity), -      "hashtags" => [] +      "hashtags" => tags      }      json(conn, res)  | 
