From f58e2ffd0f31c6c003d64a9d363905f94bfe5481 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20Vay=C3=A1?= Date: Fri, 25 Oct 2019 19:58:48 +0200 Subject: [PATCH] [MM-19344] add option to render latex (#12907) --- app/diagnostics.go | 1 + config/client.go | 1 + model/config.go | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/app/diagnostics.go b/app/diagnostics.go index ac7203156d..08d9c150e3 100644 --- a/app/diagnostics.go +++ b/app/diagnostics.go @@ -300,6 +300,7 @@ func (a *App) trackConfig() { "disable_bots_when_owner_is_deactivated": *cfg.ServiceSettings.DisableBotsWhenOwnerIsDeactivated, "enable_bot_account_creation": *cfg.ServiceSettings.EnableBotAccountCreation, "enable_svgs": *cfg.ServiceSettings.EnableSVGs, + "enable_latex": *cfg.ServiceSettings.EnableLatex, }) a.SendDiagnostic(TRACK_CONFIG_TEAM, map[string]interface{}{ diff --git a/config/client.go b/config/client.go index 3c1eca98cb..a0f47f86a4 100644 --- a/config/client.go +++ b/config/client.go @@ -44,6 +44,7 @@ func GenerateClientConfig(c *model.Config, diagnosticId string, license *model.L props["ExperimentalGroupUnreadChannels"] = *c.ServiceSettings.ExperimentalGroupUnreadChannels props["EnableSVGs"] = strconv.FormatBool(*c.ServiceSettings.EnableSVGs) props["EnableMarketplace"] = strconv.FormatBool(*c.PluginSettings.EnableMarketplace) + props["EnableLatex"] = strconv.FormatBool(*c.ServiceSettings.EnableLatex) // This setting is only temporary, so keep using the old setting name for the mobile and web apps props["ExperimentalEnablePostMetadata"] = "true" diff --git a/model/config.go b/model/config.go index 9fd2d291e3..12079f4126 100644 --- a/model/config.go +++ b/model/config.go @@ -325,6 +325,7 @@ type ServiceSettings struct { DisableBotsWhenOwnerIsDeactivated *bool `restricted:"true"` EnableBotAccountCreation *bool EnableSVGs *bool + EnableLatex *bool } func (s *ServiceSettings) SetDefaults(isUpdate bool) { @@ -689,6 +690,14 @@ func (s *ServiceSettings) SetDefaults(isUpdate bool) { s.EnableSVGs = NewBool(false) } } + + if s.EnableLatex == nil { + if isUpdate { + s.EnableLatex = NewBool(true) + } else { + s.EnableLatex = NewBool(false) + } + } } type ClusterSettings struct {