Do not make an API call if toot has no content
authorMikael Berthe <mikael@lilotux.net>
Sat, 06 May 2017 18:16:08 +0200
changeset 70 155fdea254c3
parent 69 7217174c217a
child 71 67e3234c26a9
Do not make an API call if toot has no content
cmd/toot.go
--- a/cmd/toot.go	Fri May 05 21:55:09 2017 +0000
+++ b/cmd/toot.go	Sat May 06 18:16:08 2017 +0200
@@ -82,5 +82,9 @@
 		}
 	}
 
+	if tootText == "" && len(ids) == 0 && opt.spoiler == "" {
+		return nil, errors.New("toot is empty")
+	}
+
 	return gClient.PostStatus(tootText, opt.inReplyToID, ids, opt.sensitive, opt.spoiler, opt.visibility)
 }