diff --git a/clients.go b/clients.go index ab9363f..0f439e9 100644 --- a/clients.go +++ b/clients.go @@ -49,7 +49,7 @@ var ( plebstrIOS = ClientReference{ID: "plebstr", Name: "Plebstr", Base: "plebstr:{code}", Platform: "ios"} ) -func generateClientList(kind int, code string) []ClientReference { +func generateClientList(kind int, code string, withModifiers ...func(string) string) []ClientReference { var clients []ClientReference switch kind { case -1: // relays @@ -101,6 +101,9 @@ func generateClientList(kind int, code string) []ClientReference { for i, c := range clients { clients[i].URL = templ.SafeURL(strings.Replace(c.Base, "{code}", code, -1)) + for _, modifier := range withModifiers { + clients[i].URL = templ.SafeURL(modifier(string(clients[i].URL))) + } } return clients diff --git a/render_event.go b/render_event.go index 305db7d..a628c46 100644 --- a/render_event.go +++ b/render_event.go @@ -401,7 +401,14 @@ func renderEvent(w http.ResponseWriter, r *http.Request) { Subject: subject, TitleizedContent: titleizedContent, Alt: data.alt, - Clients: generateClientList(data.event.Kind, data.naddr), + Clients: generateClientList(data.event.Kind, data.naddr, + func(s string) string { + if strings.Contains(s, "nostrudel") { + s = strings.Replace(s, "/u/", "/streams/", 1) + } + return s + }, + ), LiveEvent: *data.kind30311Metadata, })