support block masking for /id and user's comments

This commit is contained in:
Umputun
2018-02-12 16:44:31 -06:00
parent 7419686aaf
commit 9d9d06457a
+2 -1
View File
@@ -283,6 +283,7 @@ func (s *Server) commentByIDCtrl(w http.ResponseWriter, r *http.Request) {
common.SendErrorJSON(w, r, http.StatusBadRequest, err, "can't get comment by id")
return
}
comment = s.mod.maskBlockedUsers([]store.Comment{comment})[0]
render.Status(r, http.StatusOK)
renderJSONWithHTML(w, r, comment)
}
@@ -305,7 +306,7 @@ func (s *Server) findUserCommentsCtrl(w http.ResponseWriter, r *http.Request) {
if e != nil {
return nil, e
}
comments = s.mod.maskBlockedUsers(comments)
resp.Comments, resp.Count = comments, count
return encodeJSONWithHTML(resp)
})