Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #2001 and fix issue comments hidden #2016

Merged
merged 6 commits into from
Jun 21, 2017

Conversation

lunny
Copy link
Member

@lunny lunny commented Jun 20, 2017

@lunny lunny added the type/bug label Jun 20, 2017
@lunny lunny added this to the 1.2.0 milestone Jun 20, 2017
@lunny lunny changed the title revert #2001 and fix issue comments hidden Fix #2001 and fix issue comments hidden Jun 20, 2017
@lafriks
Copy link
Member

lafriks commented Jun 20, 2017

LGTM

@tboerger tboerger added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Jun 20, 2017
if opts.Since > 0 {
cond = cond.And(builder.Gte{"comment.updated_unix": opts.Since})
}
if opts.Type > -1 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably it would be better to use opts.Type != CommentTypeUnknown in this case

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

cond = cond.And(builder.Eq{"issue.repo_id": opts.RepoID})
}
if opts.IssueID > 0 {
cond = cond.And(builder.Eq{"issue.id": opts.IssueID})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could use "comment.issue_id" instead of "issue.id", so that we can avoid joining if opts.RepoID is 0.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

Asc("created_unix")
if since > 0 {
sess.And("updated_unix >= ?", since)
// FindCommentsOptions describes the condtions to Find comments
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

condtions -> conditions

sess.And("comment.updated_unix >= ?", since)
}
return comments, sess.Find(&comments)
return comments, e.Join("INNER", "issue", "issue.id = comment.issue_id").
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The join is only necessary if opts.RepoID > 0, it would be preferable to only join when we have to.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@ethantkoenig
Copy link
Member

LGTM

@tboerger tboerger added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jun 20, 2017
@lunny
Copy link
Member Author

lunny commented Jun 21, 2017

make L-G-T-M work

@lunny lunny merged commit d71fad2 into go-gitea:master Jun 21, 2017
@lunny lunny deleted the lunny/fix_issue_comment_hide branch June 21, 2017 01:00
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants