From d8df66c00cadbde1aa35dd9fcdb520bb5bd230ce Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Mon, 25 Apr 2016 08:20:45 -0400 Subject: Fixed updating mention keys when a user's username changes (#2774) --- store/sql_user_store.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'store') diff --git a/store/sql_user_store.go b/store/sql_user_store.go index ea83458e9..636400ce9 100644 --- a/store/sql_user_store.go +++ b/store/sql_user_store.go @@ -141,14 +141,7 @@ func (us SqlUserStore) Update(user *model.User, allowActiveUpdate bool) StoreCha } if user.Username != oldUser.Username { - nonUsernameKeys := []string{} - splitKeys := strings.Split(user.NotifyProps["mention_keys"], ",") - for _, key := range splitKeys { - if key != oldUser.Username && key != "@"+oldUser.Username { - nonUsernameKeys = append(nonUsernameKeys, key) - } - } - user.NotifyProps["mention_keys"] = strings.Join(nonUsernameKeys, ",") + "," + user.Username + ",@" + user.Username + user.UpdateMentionKeysFromUsername(oldUser.Username) } if count, err := us.GetMaster().Update(user); err != nil { -- cgit v1.2.3-1-g7c22