@@ -56,6 +56,47 @@ func (n *actionsNotifier) NewIssue(ctx context.Context, issue *issues_model.Issu
56
56
}).Notify (withMethod (ctx , "NewIssue" ))
57
57
}
58
58
59
+ // IssueChangeContent notifies change content of issue
60
+ func (n * actionsNotifier ) IssueChangeContent (ctx context.Context , doer * user_model.User , issue * issues_model.Issue , oldContent string ) {
61
+ ctx = withMethod (ctx , "IssueChangeContent" )
62
+
63
+ var err error
64
+ if err = issue .LoadRepo (ctx ); err != nil {
65
+ log .Error ("LoadRepo: %v" , err )
66
+ return
67
+ }
68
+
69
+ permission , _ := access_model .GetUserRepoPermission (ctx , issue .Repo , issue .Poster )
70
+ if issue .IsPull {
71
+ if err = issue .LoadPullRequest (ctx ); err != nil {
72
+ log .Error ("loadPullRequest: %v" , err )
73
+ return
74
+ }
75
+ newNotifyInputFromIssue (issue , webhook_module .HookEventPullRequest ).
76
+ WithDoer (doer ).
77
+ WithPayload (& api.PullRequestPayload {
78
+ Action : api .HookIssueEdited ,
79
+ Index : issue .Index ,
80
+ PullRequest : convert .ToAPIPullRequest (ctx , issue .PullRequest , nil ),
81
+ Repository : convert .ToRepo (ctx , issue .Repo , access_model.Permission {AccessMode : perm_model .AccessModeNone }),
82
+ Sender : convert .ToUser (ctx , doer , nil ),
83
+ }).
84
+ WithPullRequest (issue .PullRequest ).
85
+ Notify (ctx )
86
+ return
87
+ }
88
+ newNotifyInputFromIssue (issue , webhook_module .HookEventIssues ).
89
+ WithDoer (doer ).
90
+ WithPayload (& api.IssuePayload {
91
+ Action : api .HookIssueEdited ,
92
+ Index : issue .Index ,
93
+ Issue : convert .ToAPIIssue (ctx , issue ),
94
+ Repository : convert .ToRepo (ctx , issue .Repo , permission ),
95
+ Sender : convert .ToUser (ctx , doer , nil ),
96
+ }).
97
+ Notify (ctx )
98
+ }
99
+
59
100
// IssueChangeStatus notifies close or reopen issue to notifiers
60
101
func (n * actionsNotifier ) IssueChangeStatus (ctx context.Context , doer * user_model.User , commitID string , issue * issues_model.Issue , _ * issues_model.Comment , isClosed bool ) {
61
102
ctx = withMethod (ctx , "IssueChangeStatus" )
0 commit comments