@@ -68,11 +68,11 @@ func handler(items ...notificationOpts) []notificationOpts {
6868 log .Error ("CreateRepoTransferNotification: %v" , err )
6969 }
7070 case activities_model .NotificationSourceCommit :
71- if err := activities_model .CreateCommitNotifications (db .DefaultContext , opts .RepoID , opts .NotificationAuthorID , opts .CommitID , opts .ReceiverID ); err != nil {
71+ if err := activities_model .CreateCommitNotifications (db .DefaultContext , opts .NotificationAuthorID , opts .RepoID , opts .CommitID , opts .ReceiverID ); err != nil {
7272 log .Error ("Was unable to create commit notification: %v" , err )
7373 }
7474 case activities_model .NotificationSourceRelease :
75- if err := activities_model .CreateOrUpdateReleaseNotifications (db .DefaultContext , opts .NotificationAuthorID , opts .ReleaseID , opts .ReceiverID ); err != nil {
75+ if err := activities_model .CreateOrUpdateReleaseNotifications (db .DefaultContext , opts .NotificationAuthorID , opts .RepoID , opts . ReleaseID , opts .ReceiverID ); err != nil {
7676 log .Error ("Was unable to create release notification: %v" , err )
7777 }
7878 case activities_model .NotificationSourceIssue , activities_model .NotificationSourcePullRequest :
@@ -96,37 +96,30 @@ func (ns *notificationService) CreateIssueComment(ctx context.Context, doer *use
9696 opts := notificationOpts {
9797 Source : util .Iif (issue .IsPull , activities_model .NotificationSourcePullRequest , activities_model .NotificationSourceIssue ),
9898 IssueID : issue .ID ,
99+ RepoID : issue .RepoID ,
99100 NotificationAuthorID : doer .ID ,
100101 }
101102 if comment != nil {
102103 opts .CommentID = comment .ID
103104 }
104105 _ = ns .queue .Push (opts )
105106 for _ , mention := range mentions {
106- opts := notificationOpts {
107- IssueID : issue .ID ,
108- NotificationAuthorID : doer .ID ,
109- ReceiverID : mention .ID ,
110- }
111- if comment != nil {
112- opts .CommentID = comment .ID
113- }
107+ opts .ReceiverID = mention .ID
114108 _ = ns .queue .Push (opts )
115109 }
116110}
117111
118112func (ns * notificationService ) NewIssue (ctx context.Context , issue * issues_model.Issue , mentions []* user_model.User ) {
119- _ = ns . queue . Push ( notificationOpts {
113+ opts := notificationOpts {
120114 Source : activities_model .NotificationSourceIssue ,
115+ RepoID : issue .RepoID ,
121116 IssueID : issue .ID ,
122117 NotificationAuthorID : issue .Poster .ID ,
123- })
118+ }
119+ _ = ns .queue .Push (opts )
124120 for _ , mention := range mentions {
125- _ = ns .queue .Push (notificationOpts {
126- IssueID : issue .ID ,
127- NotificationAuthorID : issue .Poster .ID ,
128- ReceiverID : mention .ID ,
129- })
121+ opts .ReceiverID = mention .ID
122+ _ = ns .queue .Push (opts )
130123 }
131124}
132125
@@ -212,14 +205,7 @@ func (ns *notificationService) PullRequestReview(ctx context.Context, pr *issues
212205 }
213206 _ = ns .queue .Push (opts )
214207 for _ , mention := range mentions {
215- opts := notificationOpts {
216- IssueID : pr .Issue .ID ,
217- NotificationAuthorID : r .Reviewer .ID ,
218- ReceiverID : mention .ID ,
219- }
220- if c != nil {
221- opts .CommentID = c .ID
222- }
208+ opts .ReceiverID = mention .ID
223209 _ = ns .queue .Push (opts )
224210 }
225211}
@@ -366,6 +352,7 @@ func (ns *notificationService) NewRelease(ctx context.Context, rel *repo_model.R
366352func (ns * notificationService ) UpdateRelease (ctx context.Context , doer * user_model.User , rel * repo_model.Release ) {
367353 opts := notificationOpts {
368354 Source : activities_model .NotificationSourceRelease ,
355+ RepoID : rel .RepoID ,
369356 ReleaseID : rel .ID ,
370357 NotificationAuthorID : rel .PublisherID ,
371358 }
0 commit comments