Browse Source

issue_mail: fix issue poster not receive email if not watching (#2929)

pull/3422/merge
Unknwon 8 years ago
parent
commit
5f058c3f07
No known key found for this signature in database
GPG Key ID: 25B575AE3213B2B3
  1. 8
      models/issue_mail.go

8
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) 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)) names := make([]string, 0, len(watchers))
for i := range watchers { for i := range watchers {
if watchers[i].UserID == doer.ID { if watchers[i].UserID == doer.ID {

Loading…
Cancel
Save