From 9d9d06457a8bfbaa6bee785c2150200fa46a6dfd Mon Sep 17 00:00:00 2001 From: Umputun Date: Mon, 12 Feb 2018 16:44:31 -0600 Subject: [PATCH] support block masking for /id and user's comments --- app/rest/server.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/rest/server.go b/app/rest/server.go index 5dba3901..793642cd 100644 --- a/app/rest/server.go +++ b/app/rest/server.go @@ -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) })