src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt

changeset 242
b7f3e972b13c
parent 232
296e12ff8d1c
child 247
e71ae69c68c0
equal deleted inserted replaced
241:1ca4f27cefe8 242:b7f3e972b13c
529 if (originalAuthor != null && originalAuthor == http.remoteUser) { 529 if (originalAuthor != null && originalAuthor == http.remoteUser) {
530 val newComment = http.param("comment") 530 val newComment = http.param("comment")
531 if (!newComment.isNullOrBlank()) { 531 if (!newComment.isNullOrBlank()) {
532 comment.comment = newComment 532 comment.comment = newComment
533 dao.updateComment(comment) 533 dao.updateComment(comment)
534 dao.insertHistoryEvent(comment) 534 dao.insertHistoryEvent(issue, comment)
535 } else { 535 } else {
536 logger().debug("Not updating comment ${comment.id} because nothing changed.") 536 logger().debug("Not updating comment ${comment.id} because nothing changed.")
537 } 537 }
538 } else { 538 } else {
539 http.response.sendError(403) 539 http.response.sendError(403)
543 val comment = IssueComment(-1, issue.id).apply { 543 val comment = IssueComment(-1, issue.id).apply {
544 author = http.remoteUser?.let { dao.findUserByName(it) } 544 author = http.remoteUser?.let { dao.findUserByName(it) }
545 comment = http.param("comment") ?: "" 545 comment = http.param("comment") ?: ""
546 } 546 }
547 val newId = dao.insertComment(comment) 547 val newId = dao.insertComment(comment)
548 dao.insertHistoryEvent(comment, newId) 548 dao.insertHistoryEvent(issue, comment, newId)
549 } 549 }
550 550
551 http.renderCommit("${issuesHref}${issue.id}") 551 http.renderCommit("${issuesHref}${issue.id}")
552 } 552 }
553 } 553 }
600 val comment = IssueComment(-1, issue.id).apply { 600 val comment = IssueComment(-1, issue.id).apply {
601 author = http.remoteUser?.let { dao.findUserByName(it) } 601 author = http.remoteUser?.let { dao.findUserByName(it) }
602 comment = newComment 602 comment = newComment
603 } 603 }
604 val commentid = dao.insertComment(comment) 604 val commentid = dao.insertComment(comment)
605 dao.insertHistoryEvent(comment, commentid) 605 dao.insertHistoryEvent(issue, comment, commentid)
606 } 606 }
607 issue.id 607 issue.id
608 } 608 }
609 609
610 if (http.param("more") != null) { 610 if (http.param("more") != null) {

mercurial