sdk: pubkey feeds, live and past pages.

This commit is contained in:
fiatjaf
2025-01-20 12:59:27 -03:00
parent 40538486d5
commit f992c6e7ea
5 changed files with 159 additions and 88 deletions

View File

@@ -28,9 +28,3 @@ func encodeTimestamp(t nostr.Timestamp) []byte {
func decodeTimestamp(b []byte) nostr.Timestamp {
return nostr.Timestamp(binary.BigEndian.Uint32(b))
}
// shouldRefreshFromNetwork checks if we should try fetching from network
func shouldRefreshFromNetwork(lastFetchData []byte) bool {
lastFetch := decodeTimestamp(lastFetchData)
return nostr.Now()-lastFetch > 7*24*60*60
}