Skip to content

Commit

Permalink
cosmetic change
Browse files Browse the repository at this point in the history
  • Loading branch information
mattn committed Jan 18, 2024
1 parent 026d0af commit 6f66197
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions timeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -884,21 +884,22 @@ func doStream(cCtx *cli.Context) error {
continue
}
json.NewEncoder(os.Stdout).Encode(ev)
if reply != "" {
var evr nostr.Event
evr.PubKey = pub
evr.Content = reply
evr.Tags = evr.Tags.AppendUnique(nostr.Tag{"e", ev.ID, "", "reply"})
evr.CreatedAt = nostr.Now()
evr.Kind = nostr.KindTextNote
if err := evr.Sign(sk); err != nil {
return err
}
cfg.Do(Relay{Write: true}, func(ctx context.Context, relay *nostr.Relay) bool {
relay.Publish(ctx, evr)
return true
})
if reply == "" {
continue
}
var evr nostr.Event
evr.PubKey = pub
evr.Content = reply
evr.Tags = evr.Tags.AppendUnique(nostr.Tag{"e", ev.ID, "", "reply"})
evr.CreatedAt = nostr.Now()
evr.Kind = nostr.KindTextNote
if err := evr.Sign(sk); err != nil {
return err
}
cfg.Do(Relay{Write: true}, func(ctx context.Context, relay *nostr.Relay) bool {
relay.Publish(ctx, evr)
return true
})
} else {
json.NewEncoder(os.Stdout).Encode(ev)
}
Expand Down

0 comments on commit 6f66197

Please sign in to comment.