diff options
author | Christopher Speller <crspeller@gmail.com> | 2018-07-10 01:54:25 -0700 |
---|---|---|
committer | Carlos Tadeu Panato Junior <ctadeu@gmail.com> | 2018-07-10 10:54:25 +0200 |
commit | 74e5d8ae66186a82e8afdd845a108d6a662751d7 (patch) | |
tree | faeeee70a251b636bae0afb4e60c611e00c2cc6b /app/command_invite_people.go | |
parent | 951e4ad98401e9828b9941224318f105fb15d500 (diff) | |
download | chat-74e5d8ae66186a82e8afdd845a108d6a662751d7.tar.gz chat-74e5d8ae66186a82e8afdd845a108d6a662751d7.tar.bz2 chat-74e5d8ae66186a82e8afdd845a108d6a662751d7.zip |
MM-11120 Adding setting to disable email invitations and rate limiting. (#9063)
* Adding setting to disable email invitations.
* Adding a setting and rate limiting for email invite sending.
* Modifying email rate limit to 20/user/hour
* Adding EnableEmailInvitations to client side config and command.
Diffstat (limited to 'app/command_invite_people.go')
-rw-r--r-- | app/command_invite_people.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/command_invite_people.go b/app/command_invite_people.go index c3dc4f469..9ced3c5a1 100644 --- a/app/command_invite_people.go +++ b/app/command_invite_people.go @@ -28,7 +28,7 @@ func (me *InvitePeopleProvider) GetTrigger() string { func (me *InvitePeopleProvider) GetCommand(a *App, T goi18n.TranslateFunc) *model.Command { autoComplete := true - if !a.Config().EmailSettings.SendEmailNotifications || !*a.Config().TeamSettings.EnableUserCreation { + if !a.Config().EmailSettings.SendEmailNotifications || !*a.Config().TeamSettings.EnableUserCreation || !*a.Config().ServiceSettings.EnableEmailInvitations { autoComplete = false } return &model.Command{ @@ -49,6 +49,10 @@ func (me *InvitePeopleProvider) DoCommand(a *App, args *model.CommandArgs, messa return &model.CommandResponse{ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL, Text: args.T("api.command.invite_people.invite_off")} } + if !*a.Config().ServiceSettings.EnableEmailInvitations { + return &model.CommandResponse{ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL, Text: args.T("api.command.invite_people.email_invitations_off")} + } + emailList := strings.Fields(message) for i := len(emailList) - 1; i >= 0; i-- { |