From 464f043d63eb595a5b374b4f2f7008104ffc1e4e Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sat, 11 Nov 2023 07:45:23 -0300 Subject: [PATCH] reverse sort order: newer stuff at the top. --- nostr.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nostr.go b/nostr.go index c51c581..03fcd4c 100644 --- a/nostr.go +++ b/nostr.go @@ -243,7 +243,7 @@ func authorLastNotes(ctx context.Context, pubkey string, relays []string, isSite } // sort before returning - slices.SortFunc(lastNotes, func(a, b *nostr.Event) int { return int(a.CreatedAt - b.CreatedAt) }) + slices.SortFunc(lastNotes, func(a, b *nostr.Event) int { return int(b.CreatedAt - a.CreatedAt) }) return lastNotes } @@ -272,7 +272,7 @@ func relayLastNotes(ctx context.Context, relayUrl string, isSitemap bool) []*nos }) } - slices.SortFunc(lastNotes, func(a, b *nostr.Event) int { return int(a.CreatedAt - b.CreatedAt) }) + slices.SortFunc(lastNotes, func(a, b *nostr.Event) int { return int(b.CreatedAt - a.CreatedAt) }) if len(lastNotes) > 0 { cache.SetJSONWithTTL(key, lastNotes, time.Hour*24) }