You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

content.go 673B

123456789101112131415161718192021222324
  1. // Copyright 2019 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package issue
  4. import (
  5. "code.gitea.io/gitea/models/db"
  6. issues_model "code.gitea.io/gitea/models/issues"
  7. user_model "code.gitea.io/gitea/models/user"
  8. "code.gitea.io/gitea/modules/notification"
  9. )
  10. // ChangeContent changes issue content, as the given user.
  11. func ChangeContent(issue *issues_model.Issue, doer *user_model.User, content string) (err error) {
  12. oldContent := issue.Content
  13. if err := issues_model.ChangeIssueContent(issue, doer, content); err != nil {
  14. return err
  15. }
  16. notification.NotifyIssueChangeContent(db.DefaultContext, doer, issue, oldContent)
  17. return nil
  18. }