summaryrefslogtreecommitdiffstats
path: root/models/issue.go
diff options
context:
space:
mode:
authormrsdizzie <info@mrsdizzie.com>2019-07-17 15:02:42 -0400
committertechknowlogick <techknowlogick@gitea.io>2019-07-17 15:02:42 -0400
commit944d904980f7b161a96d5208d59c20004429d126 (patch)
tree1370357a8e7c22f7a08d04c9c5bfc5146a1778ae /models/issue.go
parent5d3e3518645d707d99c6ea244a195b7240782e74 (diff)
downloadgitea-944d904980f7b161a96d5208d59c20004429d126.tar.gz
gitea-944d904980f7b161a96d5208d59c20004429d126.zip
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
Diffstat (limited to 'models/issue.go')
-rw-r--r--models/issue.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/models/issue.go b/models/issue.go
index 63074cd40c..bde5758b02 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -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)
}