This commit is contained in:
Renato P. de Aquino 2017-01-30 11:35:12 -02:00 committed by 无闻
parent 4bc98f7aa2
commit ec5a967937

View File

@ -469,6 +469,12 @@ func (u *User) ShortName(length int) string {
return base.EllipsisString(u.Name, length) return base.EllipsisString(u.Name, length)
} }
// IsMailable checks if a user is elegible
// to receive emails.
func (u *User) IsMailable() bool {
return u.IsActive
}
// IsUserExist checks if given user name exist, // IsUserExist checks if given user name exist,
// the user name should be noncased unique. // the user name should be noncased unique.
// If uid is presented, then check will rule out that one, // If uid is presented, then check will rule out that one,
@ -929,8 +935,10 @@ func GetUserEmailsByNames(names []string) []string {
if err != nil { if err != nil {
continue continue
} }
if u.IsMailable() {
mails = append(mails, u.Email) mails = append(mails, u.Email)
} }
}
return mails return mails
} }