Update user search to match against username, full name, nickname and email (#4421)

Этот коммит содержится в:
Joram Wilander
2016-11-03 11:24:45 -04:00
коммит произвёл Corey Hulen
родитель 1b141681ae
Коммит 6da0ccd944
4 изменённых файлов: 44 добавлений и 11 удалений

Просмотреть файл

@@ -2615,7 +2615,6 @@ func searchUsers(c *Context, w http.ResponseWriter, r *http.Request) {
}
searchOptions := map[string]bool{}
searchOptions[store.USER_SEARCH_OPTION_USERNAME_ONLY] = true
searchOptions[store.USER_SEARCH_OPTION_ALLOW_INACTIVE] = props.AllowInactive
var uchan store.StoreChannel
@@ -2680,6 +2679,9 @@ func autocompleteUsersInChannel(c *Context, w http.ResponseWriter, r *http.Reque
return
}
searchOptions := map[string]bool{}
searchOptions[store.USER_SEARCH_OPTION_NAMES_ONLY] = true
uchan := Srv.Store.User().SearchInChannel(channelId, term, map[string]bool{})
nuchan := Srv.Store.User().SearchNotInChannel(teamId, channelId, term, map[string]bool{})

Просмотреть файл

@@ -2205,7 +2205,6 @@ func TestSearchUsers(t *testing.T) {
}
if _, err := Client.SearchUsers(model.UserSearch{Term: th.BasicUser.Username, NotInChannelId: th.BasicChannel.Id}); err == nil {
t.Fatal("should not have access")
}
}