diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2016-04-25 08:20:45 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-04-25 08:20:45 -0400 |
commit | d8df66c00cadbde1aa35dd9fcdb520bb5bd230ce (patch) | |
tree | d108b6375e0ca926e57d28dfd3f0266b6eaa6763 /store | |
parent | f73daebb61311efb966afdff75034a7f9c710fbf (diff) | |
download | chat-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.go | 9 |
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 { |