diff options
author | Unknwon <u@gogs.io> | 2017-03-12 13:42:19 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-03-12 13:42:19 -0400 |
commit | 5f058c3f071b5a754bdd5b556b49d678bf1477f1 (patch) | |
tree | 333657d65969530c823d15aa0c520ec2acf28938 /models/issue_mail.go | |
parent | b116dc506b55a78ef47582271f10bb810f000c47 (diff) |
issue_mail: fix issue poster not receive email if not watching (#2929)
Diffstat (limited to 'models/issue_mail.go')
-rw-r--r-- | models/issue_mail.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/models/issue_mail.go b/models/issue_mail.go index dc05496e..be653b89 100644 --- a/models/issue_mail.go +++ b/models/issue_mail.go @@ -108,7 +108,13 @@ func mailIssueCommentToParticipants(issue *Issue, doer *User, mentions []string) return fmt.Errorf("GetParticipantsByIssueID [issue_id: %d]: %v", issue.ID, err) } - tos := make([]string, 0, len(watchers)) // List of email addresses. + // In case the issue poster is not watching the repository, + // even if we have duplicated in watchers, can be safely filtered out. + if issue.PosterID != doer.ID { + participants = append(participants, issue.Poster) + } + + tos := make([]string, 0, len(watchers)) // List of email addresses names := make([]string, 0, len(watchers)) for i := range watchers { if watchers[i].UserID == doer.ID { |