Include thread related headers in issue/coment mail (#7484)

* Include thread related headers in issue/coment mail

Make it so mail programs will group comments from an issue into the same
thread by setting Message-ID on initial issue and then using In-Reply-To
and References headers to reference that later on.

* Add tests

* more tests

* fix typo
This commit is contained in:
mrsdizzie 2019-07-17 15:02:42 -04:00 committed by techknowlogick
parent 5d3e351864
commit 944d904980
3 changed files with 115 additions and 1 deletions

View file

@ -472,6 +472,18 @@ func (issue *Issue) sendLabelUpdatedWebhook(doer *User) {
}
}
// ReplyReference returns tokenized address to use for email reply headers
func (issue *Issue) ReplyReference() string {
var path string
if issue.IsPull {
path = "pulls"
} else {
path = "issues"
}
return fmt.Sprintf("%s/%s/%d@%s", issue.Repo.FullName(), path, issue.Index, setting.Domain)
}
func (issue *Issue) addLabel(e *xorm.Session, label *Label, doer *User) error {
return newIssueLabel(e, issue, label, doer)
}