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