summaryrefslogtreecommitdiffstats
path: root/store
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-04-25 08:20:45 -0400
committerChristopher Speller <crspeller@gmail.com>2016-04-25 08:20:45 -0400
commitd8df66c00cadbde1aa35dd9fcdb520bb5bd230ce (patch)
treed108b6375e0ca926e57d28dfd3f0266b6eaa6763 /store
parentf73daebb61311efb966afdff75034a7f9c710fbf (diff)
downloadchat-d8df66c00cadbde1aa35dd9fcdb520bb5bd230ce.tar.gz
chat-d8df66c00cadbde1aa35dd9fcdb520bb5bd230ce.tar.bz2
chat-d8df66c00cadbde1aa35dd9fcdb520bb5bd230ce.zip
Fixed updating mention keys when a user's username changes (#2774)
Diffstat (limited to 'store')
-rw-r--r--store/sql_user_store.go9
1 files changed, 1 insertions, 8 deletions
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 {