cmd/accounts.go
changeset 222 e93d9c738273
parent 220 08a2ee738117
child 223 0412068a9445
equal deleted inserted replaced
221:970c319e1f7c 222:e93d9c738273
    35 	accountIDs            string // For account relationships
    35 	accountIDs            string // For account relationships
    36 	statusIDs             string // For account reports
    36 	statusIDs             string // For account reports
    37 	comment               string // For account reports
    37 	comment               string // For account reports
    38 	displayName, note     string // For account update
    38 	displayName, note     string // For account update
    39 	avatar, header        string // For account update
    39 	avatar, header        string // For account update
    40 	locked                bool   // For account update
    40 	locked, bot           bool   // For account update
    41 	muteNotifications     bool   // For account mute
    41 	muteNotifications     bool   // For account mute
    42 	following             bool   // For account search
    42 	following             bool   // For account search
    43 }
    43 }
    44 
    44 
    45 func init() {
    45 func init() {
    85 	accountUpdateSubcommand.Flags().StringVar(&accountsOpts.displayName, "display-name", "", "User display name")
    85 	accountUpdateSubcommand.Flags().StringVar(&accountsOpts.displayName, "display-name", "", "User display name")
    86 	accountUpdateSubcommand.Flags().StringVar(&accountsOpts.note, "note", "", "User note (a.k.a. bio)")
    86 	accountUpdateSubcommand.Flags().StringVar(&accountsOpts.note, "note", "", "User note (a.k.a. bio)")
    87 	accountUpdateSubcommand.Flags().StringVar(&accountsOpts.avatar, "avatar", "", "User avatar image")
    87 	accountUpdateSubcommand.Flags().StringVar(&accountsOpts.avatar, "avatar", "", "User avatar image")
    88 	accountUpdateSubcommand.Flags().StringVar(&accountsOpts.header, "header", "", "User header image")
    88 	accountUpdateSubcommand.Flags().StringVar(&accountsOpts.header, "header", "", "User header image")
    89 	accountUpdateSubcommand.Flags().BoolVar(&accountsOpts.locked, "locked", false, "Following account requires approval")
    89 	accountUpdateSubcommand.Flags().BoolVar(&accountsOpts.locked, "locked", false, "Following account requires approval")
       
    90 	accountUpdateSubcommand.Flags().BoolVar(&accountsOpts.bot, "bot", false, "Set as service (automated) account")
    90 
    91 
    91 	// Those variables will be used to check if the options were
    92 	// Those variables will be used to check if the options were
    92 	// explicitly set or not
    93 	// explicitly set or not
    93 	accountUpdateFlags = accountUpdateSubcommand.Flags()
    94 	accountUpdateFlags = accountUpdateSubcommand.Flags()
    94 	accountMuteFlags = accountMuteSubcommand.Flags()
    95 	accountMuteFlags = accountMuteSubcommand.Flags()
   645 		if accountUpdateFlags.Lookup("locked").Changed {
   646 		if accountUpdateFlags.Lookup("locked").Changed {
   646 			updateParams.Locked = &opt.locked
   647 			updateParams.Locked = &opt.locked
   647 			change = true
   648 			change = true
   648 		}
   649 		}
   649 
   650 
       
   651 		if accountUpdateFlags.Lookup("bot").Changed {
       
   652 			updateParams.Bot = &opt.bot
       
   653 			change = true
       
   654 		}
       
   655 
   650 		/*
   656 		/*
   651 			TODO:
   657 			TODO:
   652 			updateParams.Bot
       
   653 			updateParams.FieldsAttributes
   658 			updateParams.FieldsAttributes
   654 			updateParams.Source
   659 			updateParams.Source
   655 		*/
   660 		*/
   656 
   661 
   657 		if !change { // We want at least one update
   662 		if !change { // We want at least one update