Add '--bot' flag to madonctl account update
authorMikael Berthe <mikael@lilotux.net>
Tue, 04 Sep 2018 18:37:42 +0200
changeset 222 e93d9c738273
parent 221 970c319e1f7c
child 223 0412068a9445
Add '--bot' flag to madonctl account update
cmd/accounts.go
--- a/cmd/accounts.go	Tue Sep 04 17:36:13 2018 +0200
+++ b/cmd/accounts.go	Tue Sep 04 18:37:42 2018 +0200
@@ -37,7 +37,7 @@
 	comment               string // For account reports
 	displayName, note     string // For account update
 	avatar, header        string // For account update
-	locked                bool   // For account update
+	locked, bot           bool   // For account update
 	muteNotifications     bool   // For account mute
 	following             bool   // For account search
 }
@@ -87,6 +87,7 @@
 	accountUpdateSubcommand.Flags().StringVar(&accountsOpts.avatar, "avatar", "", "User avatar image")
 	accountUpdateSubcommand.Flags().StringVar(&accountsOpts.header, "header", "", "User header image")
 	accountUpdateSubcommand.Flags().BoolVar(&accountsOpts.locked, "locked", false, "Following account requires approval")
+	accountUpdateSubcommand.Flags().BoolVar(&accountsOpts.bot, "bot", false, "Set as service (automated) account")
 
 	// Those variables will be used to check if the options were
 	// explicitly set or not
@@ -647,9 +648,13 @@
 			change = true
 		}
 
+		if accountUpdateFlags.Lookup("bot").Changed {
+			updateParams.Bot = &opt.bot
+			change = true
+		}
+
 		/*
 			TODO:
-			updateParams.Bot
 			updateParams.FieldsAttributes
 			updateParams.Source
 		*/