1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Add mention, read/unread support of issue tracker

This commit is contained in:
Unknown
2014-05-07 16:51:14 -04:00
parent 6fb7229bea
commit 33d32585b1
11 changed files with 354 additions and 200 deletions

View File

@@ -304,7 +304,7 @@ func DeleteUser(user *User) error {
}
// Delete all watches.
if _, err = orm.Delete(&Watch{UserId: user.Id}); err != nil {
if _, err = orm.Delete(&Watch{Uid: user.Id}); err != nil {
return err
}
@@ -392,6 +392,19 @@ func GetUserEmailsByNames(names []string) []string {
return mails
}
// GetUserIdsByNames returns a slice of ids corresponds to names.
func GetUserIdsByNames(names []string) []int64 {
ids := make([]int64, 0, len(names))
for _, name := range names {
u, err := GetUserByName(name)
if err != nil {
continue
}
ids = append(ids, u.Id)
}
return ids
}
// GetUserByEmail returns the user object by given e-mail if exists.
func GetUserByEmail(email string) (*User, error) {
if len(email) == 0 {