fix primal event links.

This commit is contained in:
fiatjaf
2024-01-31 09:27:54 -03:00
parent 2eae457cbd
commit 16eb306d1d
2 changed files with 4 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ var (
nosta = ClientReference{ID: "nosta", Name: "Nosta", Base: "https://nosta.me/{code}", Platform: "web"}
snort = ClientReference{ID: "snort", Name: "Snort", Base: "https://snort.social/{code}", Platform: "web"}
satellite = ClientReference{ID: "satellite", Name: "Satellite", Base: "https://satellite.earth/@{code}", Platform: "web"}
primalWeb = ClientReference{ID: "primal", Name: "Primal", Base: "https://primal.net/p/{code}", Platform: "web"}
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"}
iris = ClientReference{ID: "iris", Name: "Iris", Base: "https://iris.to/{code}", Platform: "web"}

View File

@@ -87,7 +87,9 @@ func renderProfile(w http.ResponseWriter, r *http.Request, code string) {
s = strings.Replace(s, "/n/", "/u/", 1)
}
if c == primalWeb {
s = strings.Replace(s, data.nprofile, data.metadata.Npub(), 1)
s = strings.Replace(
strings.Replace(s, "/e/", "/p/", 1),
data.nprofile, data.metadata.Npub(), 1)
}
return s
},