Use User.FirstName instead of trying to infer a user's first name from their nickname in multiple places.
Этот коммит содержится в:
@@ -301,10 +301,7 @@ func fireAndForgetNotifications(post *model.Post, teamId, teamUrl string) {
|
|||||||
|
|
||||||
// If turned on, add the user's case sensitive first name
|
// If turned on, add the user's case sensitive first name
|
||||||
if profile.NotifyProps["first_name"] == "true" {
|
if profile.NotifyProps["first_name"] == "true" {
|
||||||
splitName := strings.Split(profile.Nickname, " ")
|
keywordMap[profile.FirstName] = append(keywordMap[profile.FirstName], profile.Id)
|
||||||
if len(splitName) > 0 && splitName[0] != "" {
|
|
||||||
keywordMap[splitName[0]] = append(keywordMap[splitName[0]], profile.Id)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -395,10 +392,8 @@ func fireAndForgetNotifications(post *model.Post, teamId, teamUrl string) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
firstName := strings.Split(profileMap[id].Nickname, " ")[0]
|
|
||||||
|
|
||||||
bodyPage := NewServerTemplatePage("post_body", teamUrl)
|
bodyPage := NewServerTemplatePage("post_body", teamUrl)
|
||||||
bodyPage.Props["Nickname"] = firstName
|
bodyPage.Props["Nickname"] = profileMap[id].FirstName
|
||||||
bodyPage.Props["TeamName"] = teamName
|
bodyPage.Props["TeamName"] = teamName
|
||||||
bodyPage.Props["ChannelName"] = channelName
|
bodyPage.Props["ChannelName"] = channelName
|
||||||
bodyPage.Props["BodyText"] = bodyText
|
bodyPage.Props["BodyText"] = bodyText
|
||||||
|
|||||||
@@ -181,14 +181,14 @@ func CreateUser(c *Context, team *model.Team, user *model.User) *model.User {
|
|||||||
l4g.Error("Encountered an issue joining default channels user_id=%s, team_id=%s, err=%v", ruser.Id, ruser.TeamId, err)
|
l4g.Error("Encountered an issue joining default channels user_id=%s, team_id=%s, err=%v", ruser.Id, ruser.TeamId, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
//fireAndForgetWelcomeEmail(strings.Split(ruser.Nickname, " ")[0], ruser.Email, team.Name, c.TeamUrl+"/channels/town-square")
|
//fireAndForgetWelcomeEmail(ruser.FirstName, ruser.Email, team.Name, c.TeamUrl+"/channels/town-square")
|
||||||
|
|
||||||
if user.EmailVerified {
|
if user.EmailVerified {
|
||||||
if cresult := <-Srv.Store.User().VerifyEmail(ruser.Id); cresult.Err != nil {
|
if cresult := <-Srv.Store.User().VerifyEmail(ruser.Id); cresult.Err != nil {
|
||||||
l4g.Error("Failed to set email verified err=%v", cresult.Err)
|
l4g.Error("Failed to set email verified err=%v", cresult.Err)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
FireAndForgetVerifyEmail(result.Data.(*model.User).Id, strings.Split(ruser.Nickname, " ")[0], ruser.Email, team.Name, c.TeamUrl)
|
FireAndForgetVerifyEmail(result.Data.(*model.User).Id, ruser.FirstName, ruser.Email, team.Name, c.TeamUrl)
|
||||||
}
|
}
|
||||||
|
|
||||||
ruser.Sanitize(map[string]bool{})
|
ruser.Sanitize(map[string]bool{})
|
||||||
|
|||||||
@@ -351,7 +351,7 @@ func verifyEmail(c *api.Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
user := result.Data.(*model.User)
|
user := result.Data.(*model.User)
|
||||||
api.FireAndForgetVerifyEmail(user.Id, strings.Split(user.Nickname, " ")[0], user.Email, domain, c.TeamUrl)
|
api.FireAndForgetVerifyEmail(user.Id, user.FirstName, user.Email, domain, c.TeamUrl)
|
||||||
http.Redirect(w, r, "/", http.StatusFound)
|
http.Redirect(w, r, "/", http.StatusFound)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user