From 8821fee6c270042dcd4346801ceb0e8d828ed733 Mon Sep 17 00:00:00 2001 From: Jason Blais Date: Tue, 3 Jul 2018 05:26:08 -0400 Subject: Disable Gfycat by default during Beta and move default keys to server (#9027) * Update default.json * Update diagnostics.go * Added default Gfycat API credentials to server * Fixed default Gfycat credentials --- model/config.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'model') diff --git a/model/config.go b/model/config.go index e6bd04dfc..7b3a197b5 100644 --- a/model/config.go +++ b/model/config.go @@ -87,6 +87,8 @@ const ( SERVICE_SETTINGS_DEFAULT_MAX_LOGIN_ATTEMPTS = 10 SERVICE_SETTINGS_DEFAULT_ALLOW_CORS_FROM = "" SERVICE_SETTINGS_DEFAULT_LISTEN_AND_ADDRESS = ":8065" + SERVICE_SETTINGS_DEFAULT_GFYCAT_API_KEY = "2_KtH_W5" + SERVICE_SETTINGS_DEFAULT_GFYCAT_API_SECRET = "3wLVZPiswc3DnaiaFoLkDvB4X0IV6CpMkj4tf2inJRsBY6-FnkT08zGmppWFgeof" TEAM_SETTINGS_DEFAULT_MAX_USERS_PER_TEAM = 50 TEAM_SETTINGS_DEFAULT_CUSTOM_BRAND_TEXT = "" @@ -417,15 +419,15 @@ func (s *ServiceSettings) SetDefaults() { } if s.EnableGifPicker == nil { - s.EnableGifPicker = NewBool(true) + s.EnableGifPicker = NewBool(false) } - if s.GfycatApiKey == nil { - s.GfycatApiKey = NewString("") + if s.GfycatApiKey == nil || *s.GfycatApiKey == "" { + s.GfycatApiKey = NewString(SERVICE_SETTINGS_DEFAULT_GFYCAT_API_KEY) } - if s.GfycatApiSecret == nil { - s.GfycatApiSecret = NewString("") + if s.GfycatApiSecret == nil || *s.GfycatApiSecret == "" { + s.GfycatApiSecret = NewString(SERVICE_SETTINGS_DEFAULT_GFYCAT_API_SECRET) } if s.RestrictCustomEmojiCreation == nil { -- cgit v1.2.3-1-g7c22 From c66b567a1de30bf5b04f4c846d7197132907bf1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Tue, 3 Jul 2018 16:33:10 +0200 Subject: Adding RootId information to MessageExport (#9030) --- model/message_export.go | 1 + 1 file changed, 1 insertion(+) (limited to 'model') diff --git a/model/message_export.go b/model/message_export.go index 7ac50db25..1cf764a6e 100644 --- a/model/message_export.go +++ b/model/message_export.go @@ -21,6 +21,7 @@ type MessageExport struct { PostCreateAt *int64 PostMessage *string PostType *string + PostRootId *string PostOriginalId *string PostFileIds StringArray } -- cgit v1.2.3-1-g7c22 From 7c855c30dbb0326901a9c087bedd7286dafac47f Mon Sep 17 00:00:00 2001 From: Carlos Tadeu Panato Junior Date: Tue, 3 Jul 2018 18:15:15 +0200 Subject: Uncomment upgrade for 5.1.0 (#9040) --- model/version.go | 1 + 1 file changed, 1 insertion(+) (limited to 'model') diff --git a/model/version.go b/model/version.go index f86ac4ab9..0726b1a8c 100644 --- a/model/version.go +++ b/model/version.go @@ -13,6 +13,7 @@ import ( // It should be maintained in chronological order with most current // release at the front of the list. var versions = []string{ + "5.1.0", "5.0.0", "4.10.0", "4.9.0", -- cgit v1.2.3-1-g7c22 From 8d3ea1bbf6f6ef6164d26b6801c46cfe7f936fa1 Mon Sep 17 00:00:00 2001 From: Asaad Mahmood Date: Thu, 5 Jul 2018 12:18:26 +0500 Subject: MM-10766 - Replacing default profile image font (#8955) * Updating default profile pic font * Updating profile image font * Updating test * Use new default font if configured for old one * Update OFL.txt --- model/config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'model') diff --git a/model/config.go b/model/config.go index 7b3a197b5..7105af893 100644 --- a/model/config.go +++ b/model/config.go @@ -774,8 +774,8 @@ func (s *FileSettings) SetDefaults() { } if s.InitialFont == "" { - // Defaults to "luximbi.ttf" - s.InitialFont = "luximbi.ttf" + // Defaults to "nunito-bold.ttf" + s.InitialFont = "nunito-bold.ttf" } if s.Directory == "" { -- cgit v1.2.3-1-g7c22 From 6299af0fa54a9cd658e0d7fb1e5552746830cebf Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Thu, 5 Jul 2018 09:08:49 -0400 Subject: Add ability to bulk import emoji (#9048) * Add ability to bulk import emoji * Improve error handling * Update test config --- model/emoji.go | 8 ++++++-- model/emoji_test.go | 5 ----- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'model') diff --git a/model/emoji.go b/model/emoji.go index 78a266386..f14af89df 100644 --- a/model/emoji.go +++ b/model/emoji.go @@ -41,11 +41,15 @@ func (emoji *Emoji) IsValid() *AppError { return NewAppError("Emoji.IsValid", "model.emoji.update_at.app_error", nil, "id="+emoji.Id, http.StatusBadRequest) } - if len(emoji.CreatorId) != 26 { + if len(emoji.CreatorId) > 26 { return NewAppError("Emoji.IsValid", "model.emoji.user_id.app_error", nil, "", http.StatusBadRequest) } - if len(emoji.Name) == 0 || len(emoji.Name) > EMOJI_NAME_MAX_LENGTH || !IsValidAlphaNumHyphenUnderscore(emoji.Name, false) || inSystemEmoji(emoji.Name) { + return IsValidEmojiName(emoji.Name) +} + +func IsValidEmojiName(name string) *AppError { + if len(name) == 0 || len(name) > EMOJI_NAME_MAX_LENGTH || !IsValidAlphaNumHyphenUnderscore(name, false) || inSystemEmoji(name) { return NewAppError("Emoji.IsValid", "model.emoji.name.app_error", nil, "", http.StatusBadRequest) } diff --git a/model/emoji_test.go b/model/emoji_test.go index 95abe37c6..50d741214 100644 --- a/model/emoji_test.go +++ b/model/emoji_test.go @@ -40,11 +40,6 @@ func TestEmojiIsValid(t *testing.T) { } emoji.UpdateAt = 1234 - emoji.CreatorId = strings.Repeat("1", 25) - if err := emoji.IsValid(); err == nil { - t.Fatal() - } - emoji.CreatorId = strings.Repeat("1", 27) if err := emoji.IsValid(); err == nil { t.Fatal() -- cgit v1.2.3-1-g7c22