add link to remote user profile

This commit is contained in:
Ted Unangst 2019-07-28 19:00:35 -04:00
parent 686d139f54
commit 5a5080496c
1 changed files with 6 additions and 4 deletions

10
honk.go
View File

@ -566,7 +566,9 @@ func showhonker(w http.ResponseWriter, r *http.Request) {
} else {
honks = gethonksbyhonker(u.UserID, name)
}
honkpage(w, r, u, nil, honks, "honks by honker: "+name)
name = html.EscapeString(name)
msg := fmt.Sprintf(`honks by honker: <a href="%s">%s</a>`, name, name)
honkpage(w, r, u, nil, honks, template.HTML(msg))
}
func showcombo(w http.ResponseWriter, r *http.Request) {
@ -574,13 +576,13 @@ func showcombo(w http.ResponseWriter, r *http.Request) {
u := login.GetUserInfo(r)
honks := gethonksbycombo(u.UserID, name)
honks = osmosis(honks, u.UserID)
honkpage(w, r, u, nil, honks, "honks by combo: "+name)
honkpage(w, r, u, nil, honks, template.HTML(html.EscapeString("honks by combo: "+name)))
}
func showconvoy(w http.ResponseWriter, r *http.Request) {
c := r.FormValue("c")
u := login.GetUserInfo(r)
honks := gethonksbyconvoy(u.UserID, c)
honkpage(w, r, u, nil, honks, "honks in convoy: "+c)
honkpage(w, r, u, nil, honks, template.HTML(html.EscapeString("honks in convoy: "+c)))
}
func showhonk(w http.ResponseWriter, r *http.Request) {
@ -627,7 +629,7 @@ func showhonk(w http.ResponseWriter, r *http.Request) {
}
func honkpage(w http.ResponseWriter, r *http.Request, u *login.UserInfo, user *WhatAbout,
honks []*Honk, infomsg string) {
honks []*Honk, infomsg template.HTML) {
templinfo := getInfo(r)
var userid int64 = -1
if u != nil {