From 633d82f0acbb337d3777197a02e436efff8b4d7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Fri, 5 Mar 2021 09:21:58 +0100 Subject: [PATCH] Remove Custom statuses feature flag (#17075) --- api4/status.go | 6 +++--- app/command.go | 2 +- app/slashcommands/command_custom_status.go | 2 +- config/client.go | 2 +- model/feature_flags.go | 4 ---- 5 files changed, 6 insertions(+), 10 deletions(-) diff --git a/api4/status.go b/api4/status.go index 36d9606d90..9e02f21f0f 100644 --- a/api4/status.go +++ b/api4/status.go @@ -117,7 +117,7 @@ func updateUserCustomStatus(c *Context, w http.ResponseWriter, r *http.Request) return } - if !c.App.Config().FeatureFlags.CustomUserStatuses || !*c.App.Config().TeamSettings.EnableCustomUserStatuses { + if !*c.App.Config().TeamSettings.EnableCustomUserStatuses { c.Err = model.NewAppError("updateUserCustomStatus", "api.custom_status.disabled", nil, "", http.StatusNotImplemented) return } @@ -149,7 +149,7 @@ func removeUserCustomStatus(c *Context, w http.ResponseWriter, r *http.Request) return } - if !c.App.Config().FeatureFlags.CustomUserStatuses || !*c.App.Config().TeamSettings.EnableCustomUserStatuses { + if !*c.App.Config().TeamSettings.EnableCustomUserStatuses { c.Err = model.NewAppError("removeUserCustomStatus", "api.custom_status.disabled", nil, "", http.StatusNotImplemented) return } @@ -173,7 +173,7 @@ func removeUserRecentCustomStatus(c *Context, w http.ResponseWriter, r *http.Req return } - if !c.App.Config().FeatureFlags.CustomUserStatuses || !*c.App.Config().TeamSettings.EnableCustomUserStatuses { + if !*c.App.Config().TeamSettings.EnableCustomUserStatuses { c.Err = model.NewAppError("removeUserRecentCustomStatus", "api.custom_status.disabled", nil, "", http.StatusNotImplemented) return } diff --git a/app/command.go b/app/command.go index 518363b292..03a276a5ab 100644 --- a/app/command.go +++ b/app/command.go @@ -83,7 +83,7 @@ func (a *App) ListAutocompleteCommands(teamID string, T i18n.TranslateFunc) ([]* seen := make(map[string]bool) // Disable custom status slash command if the feature or the setting is off - if !a.Config().FeatureFlags.CustomUserStatuses || !*a.Config().TeamSettings.EnableCustomUserStatuses { + if !*a.Config().TeamSettings.EnableCustomUserStatuses { seen[CmdCustomStatusTrigger] = true } diff --git a/app/slashcommands/command_custom_status.go b/app/slashcommands/command_custom_status.go index 65b53d3707..287794f921 100644 --- a/app/slashcommands/command_custom_status.go +++ b/app/slashcommands/command_custom_status.go @@ -41,7 +41,7 @@ func (*CustomStatusProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model } func (*CustomStatusProvider) DoCommand(a *app.App, args *model.CommandArgs, message string) *model.CommandResponse { - if !a.Config().FeatureFlags.CustomUserStatuses || !*a.Config().TeamSettings.EnableCustomUserStatuses { + if !*a.Config().TeamSettings.EnableCustomUserStatuses { return nil } diff --git a/config/client.go b/config/client.go index 904cbb8c08..0479da6154 100644 --- a/config/client.go +++ b/config/client.go @@ -16,7 +16,7 @@ func GenerateClientConfig(c *model.Config, telemetryID string, license *model.Li props := GenerateLimitedClientConfig(c, telemetryID, license) props["SiteURL"] = strings.TrimRight(*c.ServiceSettings.SiteURL, "/") - props["EnableCustomUserStatuses"] = strconv.FormatBool(c.FeatureFlags.CustomUserStatuses && *c.TeamSettings.EnableCustomUserStatuses) + props["EnableCustomUserStatuses"] = strconv.FormatBool(*c.TeamSettings.EnableCustomUserStatuses) props["EnableUserDeactivation"] = strconv.FormatBool(*c.TeamSettings.EnableUserDeactivation) props["RestrictDirectMessage"] = *c.TeamSettings.RestrictDirectMessage props["EnableXToLeaveChannelsFromLHS"] = strconv.FormatBool(*c.TeamSettings.EnableXToLeaveChannelsFromLHS) diff --git a/model/feature_flags.go b/model/feature_flags.go index 484a645cd1..a54a1dd6d1 100644 --- a/model/feature_flags.go +++ b/model/feature_flags.go @@ -19,9 +19,6 @@ type FeatureFlags struct { // Toggle on and off support for Collapsed Threads CollapsedThreads bool - // Toggle on and off support for Custom User Statuses - CustomUserStatuses bool - // Feature flags to control plugin versions PluginIncidentManagement string `plugin_id:"com.mattermost.plugin-incident-management"` // Toggle on and off support for Files search @@ -34,7 +31,6 @@ func (f *FeatureFlags) SetDefaults() { f.CloudDelinquentEmailJobsEnabled = false f.CollapsedThreads = false f.FilesSearch = false - f.CustomUserStatuses = false f.PluginIncidentManagement = "1.5.2" }