aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2018-04-02 13:15:38 +0200
committerlain <lain@soykaf.club>2018-04-02 13:15:38 +0200
commitcd543d58a1b8ddf0f41a39800dc7a18321cd3250 (patch)
tree3bafc7d6c40258d1dc56c7539c8e11c25e9f1e22 /lib
parent0a14d155d6a55366449bc8dea638e24200bb3dd0 (diff)
parent7130e9ddb16286efd7d01088e816f05e82cfa2a1 (diff)
downloadpleroma-cd543d58a1b8ddf0f41a39800dc7a18321cd3250.tar.gz
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into develop
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/endpoint.ex3
-rw-r--r--lib/pleroma/web/mastodon_api/mastodon_api_controller.ex6
-rw-r--r--lib/pleroma/web/templates/mastodon_api/mastodon/index.html.eex7
3 files changed, 12 insertions, 4 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)
diff --git a/lib/pleroma/web/templates/mastodon_api/mastodon/index.html.eex b/lib/pleroma/web/templates/mastodon_api/mastodon/index.html.eex
index f96b15d64..6a00b9e2c 100644
--- a/lib/pleroma/web/templates/mastodon_api/mastodon/index.html.eex
+++ b/lib/pleroma/web/templates/mastodon_api/mastodon/index.html.eex
@@ -9,14 +9,17 @@
<link rel="icon" type="image/png" href="/favicon.png"/>
<link rel="stylesheet" media="all" href="/packs/common.css" />
<link rel="stylesheet" media="all" href="/packs/default.css" />
-<link rel="stylesheet" media="all" href="/packs/pl-dark-masto-fe.css" />
<script src="/packs/common.js"></script>
<script src="/packs/locale_en.js"></script>
+<link as='script' crossorigin='anonymous' href='/packs/features/getting_started.js' rel='preload'>
+<link as='script' crossorigin='anonymous' href='/packs/features/compose.js' rel='preload'>
+<link as='script' crossorigin='anonymous' href='/packs/features/home_timeline.js' rel='preload'>
+<link as='script' crossorigin='anonymous' href='/packs/features/notifications.js' rel='preload'>
<script id='initial-state' type='application/json'><%= raw @initial_state %></script>
<script src="/packs/application.js"></script>
</head>
-<body class='app-body'>
+<body class='app-body no-reduce-motion'>
<div class='app-holder' data-props='{&quot;locale&quot;:&quot;en&quot;}' id='mastodon'>
</div>
</body>