19
19
}
20
20
21
21
issueNotificationOpts struct {
22
- issueID int64
23
- commentID int64
24
- notificationAuthorID int64
22
+ IssueID int64
23
+ CommentID int64
24
+ NotificationAuthorID int64
25
25
}
26
26
)
27
27
@@ -39,7 +39,7 @@ func NewNotifier() base.Notifier {
39
39
func (ns * notificationService ) handle (data ... queue.Data ) {
40
40
for _ , datum := range data {
41
41
opts := datum .(issueNotificationOpts )
42
- if err := models .CreateOrUpdateIssueNotifications (opts .issueID , opts .commentID , opts .notificationAuthorID ); err != nil {
42
+ if err := models .CreateOrUpdateIssueNotifications (opts .IssueID , opts .CommentID , opts .NotificationAuthorID ); err != nil {
43
43
log .Error ("Was unable to create issue notification: %v" , err )
44
44
}
45
45
}
@@ -52,33 +52,33 @@ func (ns *notificationService) Run() {
52
52
func (ns * notificationService ) NotifyCreateIssueComment (doer * models.User , repo * models.Repository ,
53
53
issue * models.Issue , comment * models.Comment ) {
54
54
var opts = issueNotificationOpts {
55
- issueID : issue .ID ,
56
- notificationAuthorID : doer .ID ,
55
+ IssueID : issue .ID ,
56
+ NotificationAuthorID : doer .ID ,
57
57
}
58
58
if comment != nil {
59
- opts .commentID = comment .ID
59
+ opts .CommentID = comment .ID
60
60
}
61
61
_ = ns .issueQueue .Push (opts )
62
62
}
63
63
64
64
func (ns * notificationService ) NotifyNewIssue (issue * models.Issue ) {
65
65
_ = ns .issueQueue .Push (issueNotificationOpts {
66
- issueID : issue .ID ,
67
- notificationAuthorID : issue .Poster .ID ,
66
+ IssueID : issue .ID ,
67
+ NotificationAuthorID : issue .Poster .ID ,
68
68
})
69
69
}
70
70
71
71
func (ns * notificationService ) NotifyIssueChangeStatus (doer * models.User , issue * models.Issue , actionComment * models.Comment , isClosed bool ) {
72
72
_ = ns .issueQueue .Push (issueNotificationOpts {
73
- issueID : issue .ID ,
74
- notificationAuthorID : doer .ID ,
73
+ IssueID : issue .ID ,
74
+ NotificationAuthorID : doer .ID ,
75
75
})
76
76
}
77
77
78
78
func (ns * notificationService ) NotifyMergePullRequest (pr * models.PullRequest , doer * models.User ) {
79
79
_ = ns .issueQueue .Push (issueNotificationOpts {
80
- issueID : pr .Issue .ID ,
81
- notificationAuthorID : doer .ID ,
80
+ IssueID : pr .Issue .ID ,
81
+ NotificationAuthorID : doer .ID ,
82
82
})
83
83
}
84
84
@@ -88,18 +88,18 @@ func (ns *notificationService) NotifyNewPullRequest(pr *models.PullRequest) {
88
88
return
89
89
}
90
90
_ = ns .issueQueue .Push (issueNotificationOpts {
91
- issueID : pr .Issue .ID ,
92
- notificationAuthorID : pr .Issue .PosterID ,
91
+ IssueID : pr .Issue .ID ,
92
+ NotificationAuthorID : pr .Issue .PosterID ,
93
93
})
94
94
}
95
95
96
96
func (ns * notificationService ) NotifyPullRequestReview (pr * models.PullRequest , r * models.Review , c * models.Comment ) {
97
97
var opts = issueNotificationOpts {
98
- issueID : pr .Issue .ID ,
99
- notificationAuthorID : r .Reviewer .ID ,
98
+ IssueID : pr .Issue .ID ,
99
+ NotificationAuthorID : r .Reviewer .ID ,
100
100
}
101
101
if c != nil {
102
- opts .commentID = c .ID
102
+ opts .CommentID = c .ID
103
103
}
104
104
_ = ns .issueQueue .Push (opts )
105
105
}
0 commit comments