mirror of
https://github.com/aljazceru/njump.git
synced 2025-12-17 06:14:22 +01:00
fixing implementation of previous commit in multiple places.
This commit is contained in:
12
utils.go
12
utils.go
@@ -239,13 +239,21 @@ func getParentNevent(event *nostr.Event) string {
|
||||
return parentNevent
|
||||
}
|
||||
|
||||
func attachRelaysToEvent(event *nostr.Event, relays ...string) {
|
||||
key := "rls:" + event.ID
|
||||
func attachRelaysToEvent(eventId string, relays ...string) []string {
|
||||
key := "rls:" + eventId
|
||||
existingRelays := make([]string, 0, 10)
|
||||
if exists := cache.GetJSON(key, &existingRelays); exists {
|
||||
relays = unique(append(existingRelays, relays...))
|
||||
}
|
||||
cache.SetJSONWithTTL(key, relays, time.Hour*24*7)
|
||||
return relays
|
||||
}
|
||||
|
||||
func getRelaysForEvent(eventId string) []string {
|
||||
key := "rls:" + eventId
|
||||
relays := make([]string, 0, 10)
|
||||
cache.GetJSON(key, &relays)
|
||||
return relays
|
||||
}
|
||||
|
||||
func scheduleEventExpiration(eventId string, ts time.Duration) {
|
||||
|
||||
Reference in New Issue
Block a user