From 33d32585b1b7232c764e8cb8629a33076902c882 Mon Sep 17 00:00:00 2001
From: Unknown <joe2010xtmf@163.com>
Date: Wed, 7 May 2014 16:51:14 -0400
Subject: Add mention, read/unread support of issue tracker

---
 modules/mailer/mail.go | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

(limited to 'modules')

diff --git a/modules/mailer/mail.go b/modules/mailer/mail.go
index 2262b545..93ec1153 100644
--- a/modules/mailer/mail.go
+++ b/modules/mailer/mail.go
@@ -114,20 +114,20 @@ func SendResetPasswdMail(r *middleware.Render, user *models.User) {
 
 // SendIssueNotifyMail sends mail notification of all watchers of repository.
 func SendIssueNotifyMail(user, owner *models.User, repo *models.Repository, issue *models.Issue) ([]string, error) {
-	watches, err := models.GetWatches(repo.Id)
+	ws, err := models.GetWatchers(repo.Id)
 	if err != nil {
-		return nil, errors.New("mail.NotifyWatchers(get watches): " + err.Error())
+		return nil, errors.New("mail.NotifyWatchers(GetWatchers): " + err.Error())
 	}
 
-	tos := make([]string, 0, len(watches))
-	for i := range watches {
-		uid := watches[i].UserId
+	tos := make([]string, 0, len(ws))
+	for i := range ws {
+		uid := ws[i].Uid
 		if user.Id == uid {
 			continue
 		}
 		u, err := models.GetUserById(uid)
 		if err != nil {
-			return nil, errors.New("mail.NotifyWatchers(get user): " + err.Error())
+			return nil, errors.New("mail.NotifyWatchers(GetUserById): " + err.Error())
 		}
 		tos = append(tos, u.Email)
 	}
-- 
cgit v1.2.3