* Create the system console setting and send to webapp

* MI-1145: Add custom status APIs

* MI-1145 Add slash commands to set and clear status

* Add validation for custom status API

* Trim custom status message

* Code refactoring

- Run gofmt

- Rename constants

* Remove sendUserUpdated webhook event

* Fix recent custom status length

* Update error conditions

* Disable /status slash command when config setting is off

* MI-1155: Create the feature flag for custom status APIs and slash commands

* Move recent custom statuses to user preferences (#7)

* Move recent custom statuses to user preferences

* Code refactoring and feedback changes

* Update slash command text and emoji regex

* Make the custom status feature flag off by default

* Update SetCustomStatus, handle recents not set better

* Update status codes

* Update slash command handling

* Add telementry settings

* Fix i18n order

* Revert "Fix i18n order"

This reverts commit 499f7eaca8180336f5bcca360cc0133365899e08.

* Update i18n strings
Этот коммит содержится в:
Chetanya Kandhari
2021-02-18 16:38:01 +05:30
коммит произвёл GitHub
родитель 22308ea21c
Коммит 7585e16d84
15 изменённых файлов: 509 добавлений и 0 удалений

Просмотреть файл

@@ -22,6 +22,10 @@ import (
"github.com/mattermost/mattermost-server/v5/utils"
)
const (
CmdCustomStatusTrigger = "status"
)
type CommandProvider interface {
GetTrigger() string
GetCommand(a *App, T goi18n.TranslateFunc) *model.Command
@@ -80,6 +84,11 @@ func (a *App) ListAutocompleteCommands(teamID string, T goi18n.TranslateFunc) ([
commands := make([]*model.Command, 0, 32)
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 {
seen[CmdCustomStatusTrigger] = true
}
for _, cmd := range a.PluginCommandsForTeam(teamID) {
if cmd.AutoComplete && !seen[cmd.Trigger] {
seen[cmd.Trigger] = true