diff options
author | Chris <ccbrown112@gmail.com> | 2018-02-12 18:36:39 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-12 18:36:39 -0600 |
commit | fbef16f8630f74248157c2cd9e546ece355c869a (patch) | |
tree | 95feb1a0b94f43fd38533adc508df2daf823ea86 /cmd/platform/channel.go | |
parent | 56f49cf4860cfca51e852ec3e7d9df772d2b2060 (diff) | |
parent | 32c1f7be239ddb19d6c59b114d9ae1a543f8ba9c (diff) | |
download | chat-fbef16f8630f74248157c2cd9e546ece355c869a.tar.gz chat-fbef16f8630f74248157c2cd9e546ece355c869a.tar.bz2 chat-fbef16f8630f74248157c2cd9e546ece355c869a.zip |
Merge branch 'release-4.7' into rm-willnorris-proxy-support
Diffstat (limited to 'cmd/platform/channel.go')
-rw-r--r-- | cmd/platform/channel.go | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/cmd/platform/channel.go b/cmd/platform/channel.go index 5d86ad9da..98bdcebb8 100644 --- a/cmd/platform/channel.go +++ b/cmd/platform/channel.go @@ -106,8 +106,6 @@ func init() { channelCreateCmd.Flags().String("purpose", "", "Channel purpose") channelCreateCmd.Flags().Bool("private", false, "Create a private channel.") - moveChannelsCmd.Flags().String("username", "", "Required. Username who is moving the channel.") - deleteChannelsCmd.Flags().Bool("confirm", false, "Confirm you really want to delete the channels.") modifyChannelCmd.Flags().Bool("private", false, "Convert the channel to a private channel") @@ -321,33 +319,26 @@ func moveChannelsCmdF(cmd *cobra.Command, args []string) error { return errors.New("Unable to find destination team '" + args[0] + "'") } - username, erru := cmd.Flags().GetString("username") - if erru != nil || username == "" { - return errors.New("Username is required") - } - user := getUserFromUserArg(a, username) - channels := getChannelsFromChannelArgs(a, args[1:]) for i, channel := range channels { if channel == nil { CommandPrintErrorln("Unable to find channel '" + args[i] + "'") continue } - originTeamID := channel.TeamId - if err := moveChannel(a, team, channel, user); err != nil { + if err := moveChannel(a, team, channel); err != nil { CommandPrintErrorln("Unable to move channel '" + channel.Name + "' error: " + err.Error()) } else { - CommandPrettyPrintln("Moved channel '" + channel.Name + "' to " + team.Name + "(" + team.Id + ") from " + originTeamID + ".") + CommandPrettyPrintln("Moved channel '" + channel.Name + "'") } } return nil } -func moveChannel(a *app.App, team *model.Team, channel *model.Channel, user *model.User) *model.AppError { +func moveChannel(a *app.App, team *model.Team, channel *model.Channel) *model.AppError { oldTeamId := channel.TeamId - if err := a.MoveChannel(team, channel, user); err != nil { + if err := a.MoveChannel(team, channel); err != nil { return err } |