diff --git a/server/plugin.go b/server/plugin.go index 50ff0ed79..a2c05f0fc 100644 --- a/server/plugin.go +++ b/server/plugin.go @@ -83,7 +83,7 @@ type externalConfig struct { DisplaySubscriptionNameInNotifications bool } -const defaultMaxAttachmentSize = utils.ByteSize(10 * 1024 * 1024) // 10Mb +const defaultMaxAttachmentSize = utils.ByteSize(100 * 1024 * 1024) // 100Mb type config struct { // externalConfig caches values from the plugin's settings in the server's config.json @@ -169,6 +169,10 @@ func (p *Plugin) OnConfigurationChange() error { ec.MaxAttachmentSize = strings.TrimSpace(ec.MaxAttachmentSize) maxAttachmentSize := defaultMaxAttachmentSize + mattermostMaxAttachmentSize := p.API.GetConfig().FileSettings.MaxFileSize + if mattermostMaxAttachmentSize != nil { + maxAttachmentSize = utils.ByteSize(*mattermostMaxAttachmentSize) + } if len(ec.MaxAttachmentSize) > 0 { maxAttachmentSize, err = utils.ParseByteSize(ec.MaxAttachmentSize) if err != nil {