summaryrefslogtreecommitdiffstats
path: root/models/user.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-08-10 23:31:59 +0800
committerUnknwon <u@gogs.io>2015-08-10 23:31:59 +0800
commitcbc7b7132f03223b3d32a97f0e54887fa682c5d6 (patch)
tree36dbff5429cac31d1178087b2b9bd155ef311a45 /models/user.go
parent887bc1b594ef5c279c28c90009e67b068978482f (diff)
downloadgitea-cbc7b7132f03223b3d32a97f0e54887fa682c5d6.tar.gz
gitea-cbc7b7132f03223b3d32a97f0e54887fa682c5d6.zip
finish new issue action and mentions
Diffstat (limited to 'models/user.go')
-rw-r--r--models/user.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/models/user.go b/models/user.go
index 16caa18baf..b7bf4744de 100644
--- a/models/user.go
+++ b/models/user.go
@@ -911,18 +911,19 @@ func UnFollowUser(userId int64, unFollowId int64) (err error) {
}
func UpdateMentions(userNames []string, issueId int64) error {
+ for i := range userNames {
+ userNames[i] = strings.ToLower(userNames[i])
+ }
users := make([]*User, 0, len(userNames))
- if err := x.Where("name IN (?)", strings.Join(userNames, "\",\"")).OrderBy("name ASC").Find(&users); err != nil {
+ if err := x.Where("lower_name IN (?)", strings.Join(userNames, "\",\"")).OrderBy("lower_name ASC").Find(&users); err != nil {
return err
}
ids := make([]int64, 0, len(userNames))
-
for _, user := range users {
ids = append(ids, user.Id)
-
- if user.Type == INDIVIDUAL {
+ if !user.IsOrganization() {
continue
}
@@ -931,9 +932,7 @@ func UpdateMentions(userNames []string, issueId int64) error {
}
tempIds := make([]int64, 0, user.NumMembers)
-
orgUsers, err := GetOrgUsersByOrgId(user.Id)
-
if err != nil {
return err
}
@@ -945,7 +944,7 @@ func UpdateMentions(userNames []string, issueId int64) error {
ids = append(ids, tempIds...)
}
- if err := UpdateIssueUserPairsByMentions(ids, issueId); err != nil {
+ if err := UpdateIssueUsersByMentions(ids, issueId); err != nil {
return err
}