|
|
@ -7,6 +7,7 @@ package models |
|
|
|
import ( |
|
|
|
import ( |
|
|
|
"encoding/json" |
|
|
|
"encoding/json" |
|
|
|
"fmt" |
|
|
|
"fmt" |
|
|
|
|
|
|
|
"html" |
|
|
|
"strings" |
|
|
|
"strings" |
|
|
|
|
|
|
|
|
|
|
|
"code.gitea.io/gitea/modules/git" |
|
|
|
"code.gitea.io/gitea/modules/git" |
|
|
@ -169,7 +170,7 @@ func getTelegramIssuesPayload(p *api.IssuePayload) (*TelegramPayload, error) { |
|
|
|
|
|
|
|
|
|
|
|
func getTelegramIssueCommentPayload(p *api.IssueCommentPayload) (*TelegramPayload, error) { |
|
|
|
func getTelegramIssueCommentPayload(p *api.IssueCommentPayload) (*TelegramPayload, error) { |
|
|
|
url := fmt.Sprintf("%s/issues/%d#%s", p.Repository.HTMLURL, p.Issue.Index, CommentHashTag(p.Comment.ID)) |
|
|
|
url := fmt.Sprintf("%s/issues/%d#%s", p.Repository.HTMLURL, p.Issue.Index, CommentHashTag(p.Comment.ID)) |
|
|
|
title := fmt.Sprintf(`<a href="%s">#%d %s</a>`, url, p.Issue.Index, p.Issue.Title) |
|
|
|
title := fmt.Sprintf(`<a href="%s">#%d %s</a>`, url, p.Issue.Index, html.EscapeString(p.Issue.Title)) |
|
|
|
var text string |
|
|
|
var text string |
|
|
|
switch p.Action { |
|
|
|
switch p.Action { |
|
|
|
case api.HookIssueCommentCreated: |
|
|
|
case api.HookIssueCommentCreated: |
|
|
|