From 53cb2c0490560e8b14631d2086b773461321d8ec Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Fri, 24 Nov 2023 21:08:13 -0300 Subject: [PATCH] event: fix handling of -k and kind in stdin event, and default to 1. --- event.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/event.go b/event.go index 2f8ecd2..bbb4171 100644 --- a/event.go +++ b/event.go @@ -148,11 +148,13 @@ example: } kindWasSupplied = strings.Contains(stdinEvent, `"kind"`) } - kindWasSupplied = slices.Contains(c.FlagNames(), "kind") - if kind := c.Int("kind"); kindWasSupplied { + if kind := c.Int("kind"); slices.Contains(c.FlagNames(), "kind") { evt.Kind = kind mustRehashAndResign = true + } else if !kindWasSupplied { + evt.Kind = 1 + mustRehashAndResign = true } if content := c.String("content"); content != "" {