From 1e237b4c4265bef75c0af69bd5ba852f199c738c Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Mon, 23 Jun 2025 17:57:44 -0300 Subject: [PATCH] do not fill .Content when "content" is received empty from stdin. fixes https://github.com/fiatjaf/nak/issues/71 --- event.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/event.go b/event.go index d385e76..0a205fc 100644 --- a/event.go +++ b/event.go @@ -168,6 +168,7 @@ example: evt.Content = "" kindWasSupplied := strings.Contains(stdinEvent, `"kind"`) + contentWasSupplied := strings.Contains(stdinEvent, `"content"`) mustRehashAndResign := false if err := easyjson.Unmarshal([]byte(stdinEvent), &evt); err != nil { @@ -194,7 +195,7 @@ example: evt.Content = content } mustRehashAndResign = true - } else if evt.Content == "" && evt.Kind == 1 { + } else if !contentWasSupplied && evt.Content == "" && evt.Kind == 1 { evt.Content = "hello from the nostr army knife" mustRehashAndResign = true }