forked from forgejo/forgejo
Add mention, read/unread support of issue tracker
This commit is contained in:
parent
6fb7229bea
commit
33d32585b1
11 changed files with 354 additions and 200 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue