diff options
author | George Goldberg <george@gberg.me> | 2018-10-01 13:51:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-01 13:51:12 +0100 |
commit | a0f75cadb2b0fa91f6e321b1b8b859519b2ec865 (patch) | |
tree | 49d6333eba0aa4cc02355a740c757500e9ee4798 /app/command_invite.go | |
parent | 71e3afaf63631583202f824424ced2e3aa02d140 (diff) | |
download | chat-a0f75cadb2b0fa91f6e321b1b8b859519b2ec865.tar.gz chat-a0f75cadb2b0fa91f6e321b1b8b859519b2ec865.tar.bz2 chat-a0f75cadb2b0fa91f6e321b1b8b859519b2ec865.zip |
MM-12110: Don't /invite or /kick deactivated users. (#9494)
Diffstat (limited to 'app/command_invite.go')
-rw-r--r-- | app/command_invite.go | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/app/command_invite.go b/app/command_invite.go index 1f6006018..c4f197374 100644 --- a/app/command_invite.go +++ b/app/command_invite.go @@ -49,15 +49,21 @@ func (me *InviteProvider) DoCommand(a *App, args *model.CommandArgs, message str targetUsername := splitMessage[0] targetUsername = strings.TrimPrefix(targetUsername, "@") - var userProfile *model.User - if result := <-a.Srv.Store.User().GetByUsername(targetUsername); result.Err != nil { + result := <-a.Srv.Store.User().GetByUsername(targetUsername) + if result.Err != nil { mlog.Error(result.Err.Error()) return &model.CommandResponse{ Text: args.T("api.command_invite.missing_user.app_error"), ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL, } - } else { - userProfile = result.Data.(*model.User) + } + + userProfile := result.Data.(*model.User) + if userProfile.DeleteAt != 0 { + return &model.CommandResponse{ + Text: args.T("api.command_invite.missing_user.app_error"), + ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL, + } } var channelToJoin *model.Channel |