"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "modules/notification/indexer/indexer.go" between
gitea-1.13.1.tar.gz and gitea-1.13.2.tar.gz

About: Gitea allows to set up a self-hosted code hosting Git service (a fork of Gogs).

indexer.go  (gitea-1.13.1):indexer.go  (gitea-1.13.2)
skipping to change at line 33 skipping to change at line 33
var ( var (
_ base.Notifier = &indexerNotifier{} _ base.Notifier = &indexerNotifier{}
) )
// NewNotifier create a new indexerNotifier notifier // NewNotifier create a new indexerNotifier notifier
func NewNotifier() base.Notifier { func NewNotifier() base.Notifier {
return &indexerNotifier{} return &indexerNotifier{}
} }
func (r *indexerNotifier) NotifyCreateIssueComment(doer *models.User, repo *mode ls.Repository, func (r *indexerNotifier) NotifyCreateIssueComment(doer *models.User, repo *mode ls.Repository,
issue *models.Issue, comment *models.Comment) { issue *models.Issue, comment *models.Comment, mentions []*models.User) {
if comment.Type == models.CommentTypeComment { if comment.Type == models.CommentTypeComment {
if issue.Comments == nil { if issue.Comments == nil {
if err := issue.LoadDiscussComments(); err != nil { if err := issue.LoadDiscussComments(); err != nil {
log.Error("LoadComments failed: %v", err) log.Error("LoadComments failed: %v", err)
return return
} }
} else { } else {
issue.Comments = append(issue.Comments, comment) issue.Comments = append(issue.Comments, comment)
} }
issue_indexer.UpdateIssueIndexer(issue) issue_indexer.UpdateIssueIndexer(issue)
} }
} }
func (r *indexerNotifier) NotifyNewIssue(issue *models.Issue) { func (r *indexerNotifier) NotifyNewIssue(issue *models.Issue, mentions []*models .User) {
issue_indexer.UpdateIssueIndexer(issue) issue_indexer.UpdateIssueIndexer(issue)
} }
func (r *indexerNotifier) NotifyNewPullRequest(pr *models.PullRequest) { func (r *indexerNotifier) NotifyNewPullRequest(pr *models.PullRequest, mentions []*models.User) {
issue_indexer.UpdateIssueIndexer(pr.Issue) issue_indexer.UpdateIssueIndexer(pr.Issue)
} }
func (r *indexerNotifier) NotifyUpdateComment(doer *models.User, c *models.Comme nt, oldContent string) { func (r *indexerNotifier) NotifyUpdateComment(doer *models.User, c *models.Comme nt, oldContent string) {
if c.Type == models.CommentTypeComment { if c.Type == models.CommentTypeComment {
var found bool var found bool
if c.Issue.Comments != nil { if c.Issue.Comments != nil {
for i := 0; i < len(c.Issue.Comments); i++ { for i := 0; i < len(c.Issue.Comments); i++ {
if c.Issue.Comments[i].ID == c.ID { if c.Issue.Comments[i].ID == c.ID {
c.Issue.Comments[i] = c c.Issue.Comments[i] = c
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)