summaryrefslogtreecommitdiffstats
path: root/models/issue_comment.go
diff options
context:
space:
mode:
authorEthan Koenig <etk39@cornell.edu>2017-06-18 05:06:17 -0400
committerLunny Xiao <xiaolunwen@gmail.com>2017-06-18 17:06:17 +0800
commit255adc40ae1e0a03547326f143f685be41fa591f (patch)
tree01959c4c9b8cc62c906205aced21954d0ae90573 /models/issue_comment.go
parent4df1a240965f6d3f4e3eed2bd4bddceeb9182614 (diff)
downloadgitea-255adc40ae1e0a03547326f143f685be41fa591f.tar.gz
gitea-255adc40ae1e0a03547326f143f685be41fa591f.zip
Don't show non-comments in comments API (#2001)
Diffstat (limited to 'models/issue_comment.go')
-rw-r--r--models/issue_comment.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/models/issue_comment.go b/models/issue_comment.go
index 91d8551518..ead3f1bed3 100644
--- a/models/issue_comment.go
+++ b/models/issue_comment.go
@@ -572,6 +572,7 @@ func getCommentsByIssueIDSince(e Engine, issueID, since int64) ([]*Comment, erro
comments := make([]*Comment, 0, 10)
sess := e.
Where("issue_id = ?", issueID).
+ Where("type = ?", CommentTypeComment).
Asc("created_unix")
if since > 0 {
sess.And("updated_unix >= ?", since)
@@ -582,6 +583,7 @@ func getCommentsByIssueIDSince(e Engine, issueID, since int64) ([]*Comment, erro
func getCommentsByRepoIDSince(e Engine, repoID, since int64) ([]*Comment, error) {
comments := make([]*Comment, 0, 10)
sess := e.Where("issue.repo_id = ?", repoID).
+ Where("comment.type = ?", CommentTypeComment).
Join("INNER", "issue", "issue.id = comment.issue_id").
Asc("comment.created_unix")
if since > 0 {