1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Add support for new webhooks

Signed-off-by: Jonas Franz <info@jonasfranz.software>
This commit is contained in:
Jonas Franz
2018-05-17 14:04:43 +02:00
parent 0f64dad74b
commit 6e55557228
2 changed files with 9 additions and 9 deletions

View File

@@ -346,7 +346,7 @@ func (c *Comment) LoadReview() error {
return c.loadReview(x)
}
func (c *Comment) checkInvalidation(e Engine, repo *git.Repository, branch string) error {
func (c *Comment) checkInvalidation(e Engine, doer *User, repo *git.Repository, branch string) error {
// FIXME differentiate between previous and proposed line
commit, err := repo.LineBlame(branch, repo.Path, c.TreePath, uint(c.UnsignedLine()))
if err != nil {
@@ -354,15 +354,15 @@ func (c *Comment) checkInvalidation(e Engine, repo *git.Repository, branch strin
}
if c.CommitSHA != commit.ID.String() {
c.Invalidated = true
return UpdateComment(c)
return UpdateComment(doer, c, "")
}
return nil
}
// CheckInvalidation checks if the line of code comment got changed by another commit.
// If the line got changed the comment is going to be invalidated.
func (c *Comment) CheckInvalidation(repo *git.Repository, branch string) error {
return c.checkInvalidation(x, repo, branch)
func (c *Comment) CheckInvalidation(repo *git.Repository, doer *User, branch string) error {
return c.checkInvalidation(x, doer, repo, branch)
}
// DiffSide returns "previous" if Comment.Line is a LOC of the previous changes and "proposed" if it is a LOC of the proposed changes.