From: Ivan Tashkinov Date: Tue, 23 Feb 2021 10:58:35 +0000 (+0300) Subject: Merge remote-tracking branch 'remotes/origin/develop' into feature/object-hashtags... X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=8f88a90ca3f2f2c7c341126f6816db9667664ea7;p=akkoma Merge remote-tracking branch 'remotes/origin/develop' into feature/object-hashtags-rework # Conflicts: # lib/pleroma/application.ex # lib/pleroma/config.ex --- 8f88a90ca3f2f2c7c341126f6816db9667664ea7 diff --cc CHANGELOG.md index a7b5f6ac0,74473b3d0..974925e4f --- a/CHANGELOG.md +++ b/CHANGELOG.md @@@ -31,9 -36,9 +36,10 @@@ The format is based on [Keep a Changelo - **Breaking:** AdminAPI `GET /api/pleroma/admin/users/:nickname_or_id/statuses` changed response format and added the number of total users posts. - **Breaking:** AdminAPI `GET /api/pleroma/admin/instances/:instance/statuses` changed response format and added the number of total users posts. - Admin API: Reports now ordered by newest + - Pleroma API: `GET /api/v1/pleroma/chats` is deprecated in favor of `GET /api/v2/pleroma/chats`. +- Improved hashtag timeline performance (requires a background migration). ### Added diff --cc lib/pleroma/application.ex index 9ca048a5f,c853a2bb4..2ff7562e2 --- a/lib/pleroma/application.ex +++ b/lib/pleroma/application.ex @@@ -103,9 -104,7 +104,8 @@@ defmodule Pleroma.Application d dont_run_in_test(@mix_env) ++ chat_child(chat_enabled?()) ++ [ - Pleroma.Web.Endpoint, - Pleroma.Gopher.Server, - Pleroma.Migrators.HashtagsTableMigrator ++ Pleroma.Migrators.HashtagsTableMigrator, + Pleroma.Gopher.Server ] # See http://elixir-lang.org/docs/stable/elixir/Supervisor.html diff --cc lib/pleroma/config.ex index e057d8c02,2e15a3719..54e332595 --- a/lib/pleroma/config.ex +++ b/lib/pleroma/config.ex @@@ -99,20 -99,4 +99,8 @@@ defmodule Pleroma.Config d def oauth_consumer_strategies, do: get([:auth, :oauth_consumer_strategies], []) def oauth_consumer_enabled?, do: oauth_consumer_strategies() != [] + - def enforce_oauth_admin_scope_usage?, do: !!get([:auth, :enforce_oauth_admin_scope_usage]) - - def oauth_admin_scopes(scopes) when is_list(scopes) do - Enum.flat_map( - scopes, - fn scope -> - ["admin:#{scope}"] ++ - if enforce_oauth_admin_scope_usage?(), do: [], else: [scope] - end - ) - end - + def feature_enabled?(feature_name) do + get([:features, feature_name]) not in [nil, false, :disabled, :auto] + end end