Skip to content

Commit 21e771c

Browse files
authored
Fix notification (#10331)
1 parent f0a43a0 commit 21e771c

File tree

1 file changed

+18
-18
lines changed
  • modules/notification/ui

1 file changed

+18
-18
lines changed

modules/notification/ui/ui.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ type (
1919
}
2020

2121
issueNotificationOpts struct {
22-
issueID int64
23-
commentID int64
24-
notificationAuthorID int64
22+
IssueID int64
23+
CommentID int64
24+
NotificationAuthorID int64
2525
}
2626
)
2727

@@ -39,7 +39,7 @@ func NewNotifier() base.Notifier {
3939
func (ns *notificationService) handle(data ...queue.Data) {
4040
for _, datum := range data {
4141
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 {
4343
log.Error("Was unable to create issue notification: %v", err)
4444
}
4545
}
@@ -52,33 +52,33 @@ func (ns *notificationService) Run() {
5252
func (ns *notificationService) NotifyCreateIssueComment(doer *models.User, repo *models.Repository,
5353
issue *models.Issue, comment *models.Comment) {
5454
var opts = issueNotificationOpts{
55-
issueID: issue.ID,
56-
notificationAuthorID: doer.ID,
55+
IssueID: issue.ID,
56+
NotificationAuthorID: doer.ID,
5757
}
5858
if comment != nil {
59-
opts.commentID = comment.ID
59+
opts.CommentID = comment.ID
6060
}
6161
_ = ns.issueQueue.Push(opts)
6262
}
6363

6464
func (ns *notificationService) NotifyNewIssue(issue *models.Issue) {
6565
_ = ns.issueQueue.Push(issueNotificationOpts{
66-
issueID: issue.ID,
67-
notificationAuthorID: issue.Poster.ID,
66+
IssueID: issue.ID,
67+
NotificationAuthorID: issue.Poster.ID,
6868
})
6969
}
7070

7171
func (ns *notificationService) NotifyIssueChangeStatus(doer *models.User, issue *models.Issue, actionComment *models.Comment, isClosed bool) {
7272
_ = ns.issueQueue.Push(issueNotificationOpts{
73-
issueID: issue.ID,
74-
notificationAuthorID: doer.ID,
73+
IssueID: issue.ID,
74+
NotificationAuthorID: doer.ID,
7575
})
7676
}
7777

7878
func (ns *notificationService) NotifyMergePullRequest(pr *models.PullRequest, doer *models.User) {
7979
_ = ns.issueQueue.Push(issueNotificationOpts{
80-
issueID: pr.Issue.ID,
81-
notificationAuthorID: doer.ID,
80+
IssueID: pr.Issue.ID,
81+
NotificationAuthorID: doer.ID,
8282
})
8383
}
8484

@@ -88,18 +88,18 @@ func (ns *notificationService) NotifyNewPullRequest(pr *models.PullRequest) {
8888
return
8989
}
9090
_ = ns.issueQueue.Push(issueNotificationOpts{
91-
issueID: pr.Issue.ID,
92-
notificationAuthorID: pr.Issue.PosterID,
91+
IssueID: pr.Issue.ID,
92+
NotificationAuthorID: pr.Issue.PosterID,
9393
})
9494
}
9595

9696
func (ns *notificationService) NotifyPullRequestReview(pr *models.PullRequest, r *models.Review, c *models.Comment) {
9797
var opts = issueNotificationOpts{
98-
issueID: pr.Issue.ID,
99-
notificationAuthorID: r.Reviewer.ID,
98+
IssueID: pr.Issue.ID,
99+
NotificationAuthorID: r.Reviewer.ID,
100100
}
101101
if c != nil {
102-
opts.commentID = c.ID
102+
opts.CommentID = c.ID
103103
}
104104
_ = ns.issueQueue.Push(opts)
105105
}

0 commit comments

Comments
 (0)