aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/twitter_api/controllers
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2019-01-28 13:07:12 +0100
committerlain <lain@soykaf.club>2019-01-28 13:07:12 +0100
commit8e8a1e1ba8a08bc297884fe085b4542a052d6d01 (patch)
tree61b6366190b1c01c9bcb753604b0779347bf0180 /lib/pleroma/web/twitter_api/controllers
parentbcc559e4e61988c9d2c74dd407329b1a4c458400 (diff)
downloadpleroma-8e8a1e1ba8a08bc297884fe085b4542a052d6d01.tar.gz
Return new-style config if old-style config is set to false.
This is in preparation for 1.0. We'll be able to switch the config to the new mechanism on PleromaFE then as well.
Diffstat (limited to 'lib/pleroma/web/twitter_api/controllers')
-rw-r--r--lib/pleroma/web/twitter_api/controllers/util_controller.ex44
1 files changed, 25 insertions, 19 deletions
diff --git a/lib/pleroma/web/twitter_api/controllers/util_controller.ex b/lib/pleroma/web/twitter_api/controllers/util_controller.ex
index 085642876..b347faa71 100644
--- a/lib/pleroma/web/twitter_api/controllers/util_controller.ex
+++ b/lib/pleroma/web/twitter_api/controllers/util_controller.ex
@@ -183,25 +183,31 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
invitesEnabled: if(Keyword.get(instance, :invites_enabled, false), do: "1", else: "0")
}
- pleroma_fe = %{
- theme: Keyword.get(instance_fe, :theme),
- background: Keyword.get(instance_fe, :background),
- logo: Keyword.get(instance_fe, :logo),
- logoMask: Keyword.get(instance_fe, :logo_mask),
- logoMargin: Keyword.get(instance_fe, :logo_margin),
- redirectRootNoLogin: Keyword.get(instance_fe, :redirect_root_no_login),
- redirectRootLogin: Keyword.get(instance_fe, :redirect_root_login),
- chatDisabled: !Keyword.get(instance_chat, :enabled),
- showInstanceSpecificPanel: Keyword.get(instance_fe, :show_instance_panel),
- scopeOptionsEnabled: Keyword.get(instance_fe, :scope_options_enabled),
- formattingOptionsEnabled: Keyword.get(instance_fe, :formatting_options_enabled),
- collapseMessageWithSubject: Keyword.get(instance_fe, :collapse_message_with_subject),
- hidePostStats: Keyword.get(instance_fe, :hide_post_stats),
- hideUserStats: Keyword.get(instance_fe, :hide_user_stats),
- scopeCopy: Keyword.get(instance_fe, :scope_copy),
- subjectLineBehavior: Keyword.get(instance_fe, :subject_line_behavior),
- alwaysShowSubjectInput: Keyword.get(instance_fe, :always_show_subject_input)
- }
+ pleroma_fe =
+ if instance_fe do
+ %{
+ theme: Keyword.get(instance_fe, :theme),
+ background: Keyword.get(instance_fe, :background),
+ logo: Keyword.get(instance_fe, :logo),
+ logoMask: Keyword.get(instance_fe, :logo_mask),
+ logoMargin: Keyword.get(instance_fe, :logo_margin),
+ redirectRootNoLogin: Keyword.get(instance_fe, :redirect_root_no_login),
+ redirectRootLogin: Keyword.get(instance_fe, :redirect_root_login),
+ chatDisabled: !Keyword.get(instance_chat, :enabled),
+ showInstanceSpecificPanel: Keyword.get(instance_fe, :show_instance_panel),
+ scopeOptionsEnabled: Keyword.get(instance_fe, :scope_options_enabled),
+ formattingOptionsEnabled: Keyword.get(instance_fe, :formatting_options_enabled),
+ collapseMessageWithSubject:
+ Keyword.get(instance_fe, :collapse_message_with_subject),
+ hidePostStats: Keyword.get(instance_fe, :hide_post_stats),
+ hideUserStats: Keyword.get(instance_fe, :hide_user_stats),
+ scopeCopy: Keyword.get(instance_fe, :scope_copy),
+ subjectLineBehavior: Keyword.get(instance_fe, :subject_line_behavior),
+ alwaysShowSubjectInput: Keyword.get(instance_fe, :always_show_subject_input)
+ }
+ else
+ Pleroma.Config.get([:frontend_configurations, :pleroma_fe])
+ end
managed_config = Keyword.get(instance, :managed_config)