summaryrefslogtreecommitdiffstats
path: root/cmd/mattermost
diff options
context:
space:
mode:
authorcpanato <ctadeu@gmail.com>2018-07-10 19:27:14 +0200
committercpanato <ctadeu@gmail.com>2018-07-10 19:27:14 +0200
commitc042ffa460296587579aff54b157a5109e022f7e (patch)
tree9e7f77fbc83b6d06204db099066be8999dbb22d9 /cmd/mattermost
parent9470564d355c201155f6fcb123152b8ac954f812 (diff)
parentdccd95bc67779a5b83a2660aec0cf4622cd56550 (diff)
downloadchat-c042ffa460296587579aff54b157a5109e022f7e.tar.gz
chat-c042ffa460296587579aff54b157a5109e022f7e.tar.bz2
chat-c042ffa460296587579aff54b157a5109e022f7e.zip
Merge remote-tracking branch 'upstream/release-5.1' into release-5.1-daily-merge-20180710
Diffstat (limited to 'cmd/mattermost')
-rw-r--r--cmd/mattermost/commands/channel.go2
-rw-r--r--cmd/mattermost/commands/user.go6
2 files changed, 6 insertions, 2 deletions
diff --git a/cmd/mattermost/commands/channel.go b/cmd/mattermost/commands/channel.go
index 80740d85e..478466a34 100644
--- a/cmd/mattermost/commands/channel.go
+++ b/cmd/mattermost/commands/channel.go
@@ -339,7 +339,7 @@ func moveChannelsCmdF(command *cobra.Command, args []string) error {
channels := getChannelsFromChannelArgs(a, args[1:])
for i, channel := range channels {
if channel == nil {
- CommandPrintErrorln("Unable to find channel '" + args[i] + "'")
+ CommandPrintErrorln("Unable to find channel '" + args[i+1] + "'")
continue
}
originTeamID := channel.TeamId
diff --git a/cmd/mattermost/commands/user.go b/cmd/mattermost/commands/user.go
index 373fe7463..b3b43c076 100644
--- a/cmd/mattermost/commands/user.go
+++ b/cmd/mattermost/commands/user.go
@@ -384,7 +384,11 @@ func inviteUser(a *app.App, email string, team *model.Team, teamArg string) erro
return fmt.Errorf("Can't find team '%v'", teamArg)
}
- a.SendInviteEmails(team, "Administrator", invites, *a.Config().ServiceSettings.SiteURL)
+ if !*a.Config().ServiceSettings.EnableEmailInvitations {
+ return fmt.Errorf("Email invites are disabled.")
+ }
+
+ a.SendInviteEmails(team, "Administrator", "Mattermost CLI "+model.NewId(), invites, *a.Config().ServiceSettings.SiteURL)
CommandPrettyPrintln("Invites may or may not have been sent.")
return nil