mirror of
https://github.com/fiatjaf/nak.git
synced 2025-12-09 00:58:50 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f2f9dda33a | ||
|
|
53cb2c0490 |
8
event.go
8
event.go
@@ -139,7 +139,7 @@ example:
|
|||||||
Tags: make(nostr.Tags, 0, 3),
|
Tags: make(nostr.Tags, 0, 3),
|
||||||
}
|
}
|
||||||
|
|
||||||
kindWasSupplied := true
|
kindWasSupplied := false
|
||||||
mustRehashAndResign := false
|
mustRehashAndResign := false
|
||||||
if stdinEvent != "" {
|
if stdinEvent != "" {
|
||||||
if err := json.Unmarshal([]byte(stdinEvent), &evt); err != nil {
|
if err := json.Unmarshal([]byte(stdinEvent), &evt); err != nil {
|
||||||
@@ -148,11 +148,13 @@ example:
|
|||||||
}
|
}
|
||||||
kindWasSupplied = strings.Contains(stdinEvent, `"kind"`)
|
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
|
evt.Kind = kind
|
||||||
mustRehashAndResign = true
|
mustRehashAndResign = true
|
||||||
|
} else if !kindWasSupplied {
|
||||||
|
evt.Kind = 1
|
||||||
|
mustRehashAndResign = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if content := c.String("content"); content != "" {
|
if content := c.String("content"); content != "" {
|
||||||
|
|||||||
Reference in New Issue
Block a user