api,db: add page attributes and thread locking

This commit is contained in:
Adhityaa
2018-07-05 10:36:52 +05:30
committed by Adhityaa Chandrasekar
parent 0a03a2c6fc
commit 299649cea2
16 changed files with 427 additions and 4 deletions

View File

@@ -111,6 +111,12 @@ func commentListHandler(w http.ResponseWriter, r *http.Request) {
return
}
p, err := pageGet(domain, path)
if err != nil {
bodyMarshal(w, response{"success": false, "message": err.Error()})
return
}
commenterHex := "anonymous"
isModerator := false
if *x.CommenterToken != "anonymous" {
@@ -151,6 +157,7 @@ func commentListHandler(w http.ResponseWriter, r *http.Request) {
"requireIdentification": d.RequireIdentification,
"isFrozen": d.State == "frozen",
"isModerator": isModerator,
"attributes": p,
"configuredOauths": configuredOauths,
})
}