mirror of
https://github.com/aljazceru/njump.git
synced 2025-12-17 06:14:22 +01:00
add nostter as relay browser.
This commit is contained in:
@@ -23,6 +23,7 @@ var (
|
||||
primalWeb = ClientReference{ID: "primal", Name: "Primal", Base: "https://primal.net/e/{code}", Platform: "web"}
|
||||
nostrudel = ClientReference{ID: "nostrudel", Name: "Nostrudel", Base: "https://nostrudel.ninja/#/n/{code}", Platform: "web"}
|
||||
nostter = ClientReference{ID: "nostter", Name: "Nostter", Base: "https://nostter.app/{code}", Platform: "web"}
|
||||
nostterRelay = ClientReference{ID: "nostter", Name: "Nostter", Base: "https://nostter.app/relays/{code}", Platform: "web"}
|
||||
iris = ClientReference{ID: "iris", Name: "Iris", Base: "https://iris.to/{code}", Platform: "web"}
|
||||
coracle = ClientReference{ID: "coracle", Name: "Coracle", Base: "https://coracle.social/{code}", Platform: "web"}
|
||||
coracleRelay = ClientReference{ID: "coracle", Name: "Coracle", Base: "https://coracle.social/relays/{code}", Platform: "web"}
|
||||
@@ -66,7 +67,7 @@ func generateClientList(
|
||||
case -1: // relays
|
||||
clients = []ClientReference{
|
||||
native,
|
||||
coracleRelay, nostrrrRelay,
|
||||
nostterRelay, coracleRelay, nostrrrRelay,
|
||||
}
|
||||
case 1, 6:
|
||||
clients = []ClientReference{
|
||||
|
||||
@@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -97,7 +98,12 @@ func renderRelayPage(w http.ResponseWriter, r *http.Request) {
|
||||
Proxy: "https://" + hostname + "/njump/proxy?src=",
|
||||
LastNotes: renderableLastNotes,
|
||||
ModifiedAt: lastEventAt.Format("2006-01-02T15:04:05Z07:00"),
|
||||
Clients: generateClientList(-1, hostname),
|
||||
Clients: generateClientList(-1, hostname, func(cr ClientReference, s string) string {
|
||||
if cr == nostterRelay {
|
||||
return strings.Replace(s, hostname, url.PathEscape("wss://"+hostname), 1)
|
||||
}
|
||||
return s
|
||||
}),
|
||||
}).Render(r.Context(), w)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user