mirror of
https://github.com/aljazceru/njump.git
synced 2025-12-17 14:24:27 +01:00
use noswhere relay as a source for profiles and random ids (@semisol).
This commit is contained in:
5
nostr.go
5
nostr.go
@@ -35,9 +35,11 @@ var (
|
||||
}
|
||||
profiles = []string{
|
||||
"wss://purplepag.es",
|
||||
"wss://relay.noswhere.com",
|
||||
}
|
||||
justIds = []string{
|
||||
"wss://cache2.primal.net/v1",
|
||||
"wss://relay.noswhere.com",
|
||||
}
|
||||
|
||||
trustedPubKeys = []string{
|
||||
@@ -91,7 +93,6 @@ func getEvent(ctx context.Context, code string, relayHints []string) (*nostr.Eve
|
||||
case nostr.EventPointer:
|
||||
author = v.Author
|
||||
filter.IDs = []string{v.ID}
|
||||
relays = append(relays, getRandomRelay())
|
||||
relays = append(relays, v.Relays...)
|
||||
relays = append(relays, justIds...)
|
||||
withRelays = true
|
||||
@@ -110,7 +111,7 @@ func getEvent(ctx context.Context, code string, relayHints []string) (*nostr.Eve
|
||||
case string:
|
||||
if prefix == "note" {
|
||||
filter.IDs = []string{v}
|
||||
relays = append(relays, getRandomRelay(), getRandomRelay())
|
||||
relays = append(relays, getRandomRelay())
|
||||
relays = append(relays, justIds...)
|
||||
} else if prefix == "npub" {
|
||||
author = v
|
||||
|
||||
5
utils.go
5
utils.go
@@ -513,6 +513,11 @@ func isntRealRelay(url string) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// hardcoded
|
||||
if url == "wss://relay.noswhere.com" {
|
||||
return true
|
||||
}
|
||||
|
||||
// if there is a "/" after the initial "wss://" part that means this is probably a "virtual relay"
|
||||
// like wss://feeds.nostr.band/topic or wss://filter.nostr.wine/pubkey or wss://cache2.primal.net/v1
|
||||
// and should not be used in computing outbox model relay recommendations
|
||||
|
||||
Reference in New Issue
Block a user