diff options
author | Twenty Panda <twenty-panda@posteo.com> | 2024-07-22 11:25:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-22 13:46:38 +0200 |
commit | 14b37bb607410200a1b5d95da7a30f13d4526882 (patch) | |
tree | c428d1315aff4775a443a0a9c0e40ef68d327ffa | |
parent | Merge pull request '[v7.0/forgejo] Remove APA as cite format' (#4600) from be... (diff) | |
download | forgejo-14b37bb607410200a1b5d95da7a30f13d4526882.tar.xz forgejo-14b37bb607410200a1b5d95da7a30f13d4526882.zip |
fix(actions): no edited event triggered when a title is changed
When the title of an issue or a pull request is changed, the edited
event must be triggered, in the same way it is when the body of the
description is changed.
The web endpoints and the API endpoints for both pull requests and
issues rely on issue_service.ChangeTitle which calls
notify_service.IssueChangeTitle.
(cherry picked from commit f6000c376070f3ae55b3ae4794488f9fbe37c72a)
-rw-r--r-- | services/actions/notifier.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/services/actions/notifier.go b/services/actions/notifier.go index 3a6dd9db5b..1166bbbfd2 100644 --- a/services/actions/notifier.go +++ b/services/actions/notifier.go @@ -55,10 +55,20 @@ func (n *actionsNotifier) NewIssue(ctx context.Context, issue *issues_model.Issu }).Notify(withMethod(ctx, "NewIssue")) } +func (n *actionsNotifier) IssueChangeTitle(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, _ string) { + ctx = withMethod(ctx, "IssueChangeTitle") + + n.issueChange(ctx, doer, issue) +} + // IssueChangeContent notifies change content of issue -func (n *actionsNotifier) IssueChangeContent(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, oldContent string) { +func (n *actionsNotifier) IssueChangeContent(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, _ string) { ctx = withMethod(ctx, "IssueChangeContent") + n.issueChange(ctx, doer, issue) +} + +func (n *actionsNotifier) issueChange(ctx context.Context, doer *user_model.User, issue *issues_model.Issue) { var err error if err = issue.LoadRepo(ctx); err != nil { log.Error("LoadRepo: %v", err) |