A fork of Gitea (see branch `mj`) adding Majority Judgment Polls 𐄷 over Issues and Merge Requests. https://git.mieuxvoter.fr
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.

24 lines
637 B

  1. // Copyright 2020 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package convert
  5. import (
  6. "code.gitea.io/gitea/models"
  7. api "code.gitea.io/gitea/modules/structs"
  8. )
  9. // ToComment converts a models.Comment to the api.Comment format
  10. func ToComment(c *models.Comment) *api.Comment {
  11. return &api.Comment{
  12. ID: c.ID,
  13. Poster: ToUser(c.Poster, false, false),
  14. HTMLURL: c.HTMLURL(),
  15. IssueURL: c.IssueURL(),
  16. PRURL: c.PRURL(),
  17. Body: c.Content,
  18. Created: c.CreatedUnix.AsTime(),
  19. Updated: c.UpdatedUnix.AsTime(),
  20. }
  21. }