nip34: return events, not pointer to events.

This commit is contained in:
fiatjaf
2025-11-14 12:08:47 -03:00
parent 4b2cec9c6d
commit 017e4aea11
2 changed files with 4 additions and 4 deletions

View File

@@ -49,7 +49,7 @@ func ParseRepository(event nostr.Event) Repository {
return repo
}
func (r Repository) ToEvent() *nostr.Event {
func (r Repository) ToEvent() nostr.Event {
tags := make(nostr.Tags, 0, 10)
tags = append(tags, nostr.Tag{"d", r.ID})
@@ -88,7 +88,7 @@ func (r Repository) ToEvent() *nostr.Event {
tags = append(tags, tag)
}
return &nostr.Event{
return nostr.Event{
Kind: nostr.KindRepositoryAnnouncement,
Tags: tags,
CreatedAt: nostr.Now(),

View File

@@ -45,7 +45,7 @@ func ParseRepositoryState(event nostr.Event) RepositoryState {
return st
}
func (rs RepositoryState) ToEvent() *nostr.Event {
func (rs RepositoryState) ToEvent() nostr.Event {
tags := make(nostr.Tags, 1, 2+len(rs.Branches)+len(rs.Tags))
tags[0] = nostr.Tag{"d", rs.ID}
@@ -59,7 +59,7 @@ func (rs RepositoryState) ToEvent() *nostr.Event {
tags = append(tags, nostr.Tag{"HEAD", "ref: refs/heads/" + rs.HEAD})
}
return &nostr.Event{
return nostr.Event{
Kind: 30618,
Tags: tags,
CreatedAt: nostr.Now(),