Fix "only mail on mention" bug (#12775)

* fix mail mention bug

fix #12774

Signed-off-by: a1012112796 <1012112796@qq.com>

* fix test

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
赵智超 2020-09-10 03:08:55 +08:00 committed by GitHub
parent 0cd49aaebd
commit ffa12bdb71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 3 deletions

View file

@ -118,7 +118,7 @@ func mailIssueCommentBatch(ctx *mailCommentContext, ids []int64, visited map[int
visited[id] = true
}
}
recipients, err := models.GetMaileableUsersByIDs(unique)
recipients, err := models.GetMaileableUsersByIDs(unique, fromMention)
if err != nil {
return err
}

View file

@ -27,7 +27,7 @@ func MailNewRelease(rel *models.Release) {
return
}
recipients, err := models.GetMaileableUsersByIDs(watcherIDList)
recipients, err := models.GetMaileableUsersByIDs(watcherIDList, false)
if err != nil {
log.Error("models.GetMaileableUsersByIDs: %v", err)
return