"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "modules/notification/action/action.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).

action.go  (gitea-1.13.1):action.go  (gitea-1.13.2)
skipping to change at line 32 skipping to change at line 32
var ( var (
_ base.Notifier = &actionNotifier{} _ base.Notifier = &actionNotifier{}
) )
// NewNotifier create a new actionNotifier notifier // NewNotifier create a new actionNotifier notifier
func NewNotifier() base.Notifier { func NewNotifier() base.Notifier {
return &actionNotifier{} return &actionNotifier{}
} }
func (a *actionNotifier) NotifyNewIssue(issue *models.Issue) { func (a *actionNotifier) NotifyNewIssue(issue *models.Issue, mentions []*models. User) {
if err := issue.LoadPoster(); err != nil { if err := issue.LoadPoster(); err != nil {
log.Error("issue.LoadPoster: %v", err) log.Error("issue.LoadPoster: %v", err)
return return
} }
if err := issue.LoadRepo(); err != nil { if err := issue.LoadRepo(); err != nil {
log.Error("issue.LoadRepo: %v", err) log.Error("issue.LoadRepo: %v", err)
return return
} }
repo := issue.Repo repo := issue.Repo
skipping to change at line 91 skipping to change at line 91
} }
// Notify watchers for whatever action comes in, ignore if no action type . // Notify watchers for whatever action comes in, ignore if no action type .
if err := models.NotifyWatchers(act); err != nil { if err := models.NotifyWatchers(act); err != nil {
log.Error("NotifyWatchers: %v", err) log.Error("NotifyWatchers: %v", err)
} }
} }
// NotifyCreateIssueComment notifies comment on an issue to notifiers // NotifyCreateIssueComment notifies comment on an issue to notifiers
func (a *actionNotifier) NotifyCreateIssueComment(doer *models.User, repo *model s.Repository, func (a *actionNotifier) NotifyCreateIssueComment(doer *models.User, repo *model s.Repository,
issue *models.Issue, comment *models.Comment) { issue *models.Issue, comment *models.Comment, mentions []*models.User) {
act := &models.Action{ act := &models.Action{
ActUserID: doer.ID, ActUserID: doer.ID,
ActUser: doer, ActUser: doer,
RepoID: issue.Repo.ID, RepoID: issue.Repo.ID,
Repo: issue.Repo, Repo: issue.Repo,
Comment: comment, Comment: comment,
CommentID: comment.ID, CommentID: comment.ID,
IsPrivate: issue.Repo.IsPrivate, IsPrivate: issue.Repo.IsPrivate,
} }
skipping to change at line 123 skipping to change at line 123
} else { } else {
act.OpType = models.ActionCommentIssue act.OpType = models.ActionCommentIssue
} }
// Notify watchers for whatever action comes in, ignore if no action type . // Notify watchers for whatever action comes in, ignore if no action type .
if err := models.NotifyWatchers(act); err != nil { if err := models.NotifyWatchers(act); err != nil {
log.Error("NotifyWatchers: %v", err) log.Error("NotifyWatchers: %v", err)
} }
} }
func (a *actionNotifier) NotifyNewPullRequest(pull *models.PullRequest) { func (a *actionNotifier) NotifyNewPullRequest(pull *models.PullRequest, mentions []*models.User) {
if err := pull.LoadIssue(); err != nil { if err := pull.LoadIssue(); err != nil {
log.Error("pull.LoadIssue: %v", err) log.Error("pull.LoadIssue: %v", err)
return return
} }
if err := pull.Issue.LoadRepo(); err != nil { if err := pull.Issue.LoadRepo(); err != nil {
log.Error("pull.Issue.LoadRepo: %v", err) log.Error("pull.Issue.LoadRepo: %v", err)
return return
} }
if err := pull.Issue.LoadPoster(); err != nil { if err := pull.Issue.LoadPoster(); err != nil {
log.Error("pull.Issue.LoadPoster: %v", err) log.Error("pull.Issue.LoadPoster: %v", err)
skipping to change at line 206 skipping to change at line 206
ActUser: doer, ActUser: doer,
OpType: models.ActionCreateRepo, OpType: models.ActionCreateRepo,
RepoID: repo.ID, RepoID: repo.ID,
Repo: repo, Repo: repo,
IsPrivate: repo.IsPrivate, IsPrivate: repo.IsPrivate,
}); err != nil { }); err != nil {
log.Error("notify watchers '%d/%d': %v", doer.ID, repo.ID, err) log.Error("notify watchers '%d/%d': %v", doer.ID, repo.ID, err)
} }
} }
func (a *actionNotifier) NotifyPullRequestReview(pr *models.PullRequest, review *models.Review, comment *models.Comment) { func (a *actionNotifier) NotifyPullRequestReview(pr *models.PullRequest, review *models.Review, comment *models.Comment, mentions []*models.User) {
if err := review.LoadReviewer(); err != nil { if err := review.LoadReviewer(); err != nil {
log.Error("LoadReviewer '%d/%d': %v", review.ID, review.ReviewerI D, err) log.Error("LoadReviewer '%d/%d': %v", review.ID, review.ReviewerI D, err)
return return
} }
if err := review.LoadCodeComments(); err != nil { if err := review.LoadCodeComments(); err != nil {
log.Error("LoadCodeComments '%d/%d': %v", review.Reviewer.ID, rev iew.ID, err) log.Error("LoadCodeComments '%d/%d': %v", review.Reviewer.ID, rev iew.ID, err)
return return
} }
var actions = make([]*models.Action, 0, 10) var actions = make([]*models.Action, 0, 10)
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added

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