mirror of
https://github.com/aljazceru/njump.git
synced 2025-12-17 06:14:22 +01:00
get rid of shouldUseRelayForNip19(), use isntRealRelay().
This commit is contained in:
19
utils.go
19
utils.go
@@ -484,25 +484,6 @@ func humanDate(createdAt nostr.Timestamp) string {
|
||||
}
|
||||
}
|
||||
|
||||
func shouldUseRelayForNip19(relayUrl string) bool {
|
||||
for _, excluded := range excludedRelays {
|
||||
if strings.Contains(relayUrl, excluded) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
urlp, err := url.Parse(relayUrl)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
if urlp.Scheme != "wss" && urlp.Scheme != "ws" {
|
||||
return false
|
||||
}
|
||||
if urlp.Path != "" && urlp.Path != "/" {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func getRandomRelay() string {
|
||||
if serial == 0 {
|
||||
serial = rand.Intn(len(everything))
|
||||
|
||||
Reference in New Issue
Block a user