when looking at another user on the same server, don't display controls.
you can't interact with other users via their pages because technically it's like they are on a different server.
This commit is contained in:
parent
97b9634a9e
commit
2dd6b27356
9
web.go
9
web.go
|
@ -723,14 +723,19 @@ func showuser(w http.ResponseWriter, r *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
u := login.GetUserInfo(r)
|
u := login.GetUserInfo(r)
|
||||||
honks := gethonksbyuser(name, u != nil && u.Username == name, 0)
|
if u != nil && u.Username != name {
|
||||||
|
u = nil
|
||||||
|
}
|
||||||
|
honks := gethonksbyuser(name, u != nil, 0)
|
||||||
templinfo := getInfo(r)
|
templinfo := getInfo(r)
|
||||||
templinfo["PageName"] = "user"
|
templinfo["PageName"] = "user"
|
||||||
templinfo["PageArg"] = name
|
templinfo["PageArg"] = name
|
||||||
templinfo["Name"] = user.Name
|
templinfo["Name"] = user.Name
|
||||||
templinfo["WhatAbout"] = user.HTAbout
|
templinfo["WhatAbout"] = user.HTAbout
|
||||||
templinfo["ServerMessage"] = ""
|
templinfo["ServerMessage"] = ""
|
||||||
|
if u != nil {
|
||||||
templinfo["HonkCSRF"] = login.GetCSRF("honkhonk", r)
|
templinfo["HonkCSRF"] = login.GetCSRF("honkhonk", r)
|
||||||
|
}
|
||||||
honkpage(w, u, honks, templinfo)
|
honkpage(w, u, honks, templinfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1184,7 +1189,9 @@ func showonehonk(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
templinfo["ServerMessage"] = "one honk maybe more"
|
templinfo["ServerMessage"] = "one honk maybe more"
|
||||||
|
if u != nil {
|
||||||
templinfo["HonkCSRF"] = login.GetCSRF("honkhonk", r)
|
templinfo["HonkCSRF"] = login.GetCSRF("honkhonk", r)
|
||||||
|
}
|
||||||
templinfo["APAltLink"] = templates.Sprintf("<link href='%s' rel='alternate' type='application/activity+json'>", xid)
|
templinfo["APAltLink"] = templates.Sprintf("<link href='%s' rel='alternate' type='application/activity+json'>", xid)
|
||||||
honkpage(w, u, honks, templinfo)
|
honkpage(w, u, honks, templinfo)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue