cmd/notifications.go
changeset 22 5778b09bc6fe
parent 20 b0ccc09f07a2
child 30 14561d44211b
--- a/cmd/notifications.go	Fri Apr 28 15:53:09 2017 +0200
+++ b/cmd/notifications.go	Fri Apr 28 16:56:33 2017 +0200
@@ -42,7 +42,6 @@
 
 func notificationRunE(cmd *cobra.Command, args []string) error {
 	opt := notificationsOpts
-	var limOpts *madon.LimitParams
 
 	if !opt.list && !opt.clear && opt.notifID < 1 {
 		return errors.New("missing parameters")
@@ -52,10 +51,20 @@
 		return err
 	}
 
-	if accountsOpts.limit > 0 {
+	var limOpts *madon.LimitParams
+	if accountsOpts.limit > 0 || accountsOpts.sinceID > 0 || accountsOpts.maxID > 0 {
 		limOpts = new(madon.LimitParams)
+	}
+
+	if accountsOpts.limit > 0 {
 		limOpts.Limit = int(accountsOpts.limit)
 	}
+	if accountsOpts.maxID > 0 {
+		limOpts.MaxID = int(accountsOpts.maxID)
+	}
+	if accountsOpts.sinceID > 0 {
+		limOpts.SinceID = int(accountsOpts.sinceID)
+	}
 
 	var obj interface{}
 	var err error