--- a/cmd/notifications.go Thu Sep 22 16:37:07 2022 +0200
+++ b/cmd/notifications.go Mon Jan 23 16:39:02 2023 +0000
@@ -17,7 +17,7 @@
var notificationsOpts struct {
list, clear, dismiss bool
- notifID int64
+ notifID madon.ActivityID
types string
excludeTypes string
}
@@ -50,7 +50,7 @@
notificationsCmd.Flags().BoolVar(¬ificationsOpts.list, "list", false, "List all current notifications")
notificationsCmd.Flags().BoolVar(¬ificationsOpts.clear, "clear", false, "Clear all current notifications")
notificationsCmd.Flags().BoolVar(¬ificationsOpts.dismiss, "dismiss", false, "Delete a notification")
- notificationsCmd.Flags().Int64Var(¬ificationsOpts.notifID, "notification-id", 0, "Get a notification")
+ notificationsCmd.Flags().StringVar(¬ificationsOpts.notifID, "notification-id", "", "Get a notification")
notificationsCmd.Flags().StringVar(¬ificationsOpts.types, "notification-types", "", "Filter notifications (mention, favourite, reblog, follow)")
notificationsCmd.Flags().StringVar(¬ificationsOpts.excludeTypes, "exclude-types", "", "Exclude notifications types (mention, favourite, reblog, follow)")
}
@@ -58,7 +58,7 @@
func notificationRunE(cmd *cobra.Command, args []string) error {
opt := notificationsOpts
- if !opt.list && !opt.clear && opt.notifID < 1 {
+ if !opt.list && !opt.clear && opt.notifID == "" {
return errors.New("missing parameters")
}
@@ -67,7 +67,7 @@
}
var limOpts *madon.LimitParams
- if accountsOpts.all || accountsOpts.limit > 0 || accountsOpts.sinceID > 0 || accountsOpts.maxID > 0 {
+ if accountsOpts.all || accountsOpts.limit > 0 || accountsOpts.sinceID != "" || accountsOpts.maxID != "" {
limOpts = new(madon.LimitParams)
limOpts.All = accountsOpts.all
}
@@ -75,11 +75,11 @@
if accountsOpts.limit > 0 {
limOpts.Limit = int(accountsOpts.limit)
}
- if accountsOpts.maxID > 0 {
- limOpts.MaxID = int64(accountsOpts.maxID)
+ if accountsOpts.maxID != "" {
+ limOpts.MaxID = accountsOpts.maxID
}
- if accountsOpts.sinceID > 0 {
- limOpts.SinceID = int64(accountsOpts.sinceID)
+ if accountsOpts.sinceID != "" {
+ limOpts.SinceID = accountsOpts.sinceID
}
var filterMap *map[string]bool
@@ -123,7 +123,7 @@
notifications = notifications[:accountsOpts.keep]
}
obj = notifications
- } else if opt.notifID > 0 {
+ } else if opt.notifID != "" {
if opt.dismiss {
err = gClient.DismissNotification(opt.notifID)
} else {