HttpServletRequest request,
@RequestParam("msgid") int msgid
) throws Exception {
Map<String, Object> params = new HashMap<>();
Template tmpl = Template.getTemplate(request);
if (!tmpl.isSessionAuthorized()) {
throw new AccessViolationException("нет авторизации");
}
params.put("msgid", msgid);
Comment comment = commentService.getById(msgid);
if (comment.isDeleted()) {
throw new UserErrorException("комментарий уже удален");
}
int topicId = comment.getTopicId();
Topic topic = messageDao.getById(topicId);
if (topic.isDeleted()) {
throw new AccessViolationException("тема удалена");
}
params.put("topic", topic);
CommentList comments = commentService.getCommentList(topic, tmpl.isModeratorSession());
CommentFilter cv = new CommentFilter(comments);
List<Comment> list = cv.getCommentsSubtree(msgid);