Closed jundow closed 1 year ago
In doPost function, ev.Tags may need to be initialized with nostr.Tags{ }.
If no tags were added to the event object, the ev.Tags was nil. I observed many of relays reject event objects when it was nil.
To resolve this, initializing ev.Tags with nostr.Tags{ } (an empty array of array) worked for me.
I would suggest to add this line,
ev.Tags = nostr.Tags{ }
before the line 260 in "timeline.go."
/*Line 260: func doPost in timeline.go*/ for i, u := range cCtx.StringSlice("u") { ev.Content = fmt.Sprintf("#[%d] ", i) + ev.Content if pp := sdk.InputToProfile(u); pp == nil { return fmt.Errorf("failed to parse pubkey from '%s'", u) } else { u = pp.PublicKey } ev.Tags = ev.Tags.AppendUnique(nostr.Tag{"p", u}) } /*the function goes on...*/
If ev.Tags is nil, the corresponding part in the parsed JSON will be nil. If initialized with nostr.Tags{}, it will be "[]".
Okay, could you please send me PR ?
The issue is closed because it was resolved. (PR#10)
In doPost function, ev.Tags may need to be initialized with nostr.Tags{ }.
If no tags were added to the event object, the ev.Tags was nil. I observed many of relays reject event objects when it was nil.
To resolve this, initializing ev.Tags with nostr.Tags{ } (an empty array of array) worked for me.
I would suggest to add this line,
before the line 260 in "timeline.go."
If ev.Tags is nil, the corresponding part in the parsed JSON will be nil. If initialized with nostr.Tags{}, it will be "[]".