PLT-3143 Added serverside code for custom Emoji (#3311)
* Added model objects for emoji * Added database tables for emoji * Added settings for custom emoji * Added serverside APIs and unit tests for custom emoji * Added additional validation to catch duplicate emoji names earlier on * Added additional validation to prevent users from adding emoji as another user
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
661f221727
Коммит
a0cc913b85
@@ -34,6 +34,9 @@ const (
|
||||
DIRECT_MESSAGE_TEAM = "team"
|
||||
|
||||
FAKE_SETTING = "********************************"
|
||||
|
||||
RESTRICT_EMOJI_CREATION_ALL = "all"
|
||||
RESTRICT_EMOJI_CREATION_ADMIN = "system_admin"
|
||||
)
|
||||
|
||||
// should match the values in webapp/i18n/i18n.jsx
|
||||
@@ -70,6 +73,8 @@ type ServiceSettings struct {
|
||||
WebsocketSecurePort *int
|
||||
WebsocketPort *int
|
||||
WebserverMode *string
|
||||
EnableCustomEmoji *bool
|
||||
RestrictCustomEmojiCreation *string
|
||||
}
|
||||
|
||||
type SSOSettings struct {
|
||||
@@ -565,6 +570,16 @@ func (o *Config) SetDefaults() {
|
||||
*o.ServiceSettings.WebserverMode = "regular"
|
||||
}
|
||||
|
||||
if o.ServiceSettings.EnableCustomEmoji == nil {
|
||||
o.ServiceSettings.EnableCustomEmoji = new(bool)
|
||||
*o.ServiceSettings.EnableCustomEmoji = true
|
||||
}
|
||||
|
||||
if o.ServiceSettings.RestrictCustomEmojiCreation == nil {
|
||||
o.ServiceSettings.RestrictCustomEmojiCreation = new(string)
|
||||
*o.ServiceSettings.RestrictCustomEmojiCreation = RESTRICT_EMOJI_CREATION_ALL
|
||||
}
|
||||
|
||||
if o.ComplianceSettings.Enable == nil {
|
||||
o.ComplianceSettings.Enable = new(bool)
|
||||
*o.ComplianceSettings.Enable = false
|
||||
|
||||
Ссылка в новой задаче
Block a user