diff options
Diffstat (limited to 'api')
-rw-r--r-- | api/channel.go | 2 | ||||
-rw-r--r-- | api/user.go | 3 | ||||
-rw-r--r-- | api/web_hub.go | 1 |
3 files changed, 6 insertions, 0 deletions
diff --git a/api/channel.go b/api/channel.go index 81220a503..ea39ee398 100644 --- a/api/channel.go +++ b/api/channel.go @@ -1176,6 +1176,8 @@ func updateNotifyProps(c *Context, w http.ResponseWriter, r *http.Request) { c.Err = result.Err return } else { + InvalidateCacheForUser(userId) + // return the updated notify properties including any unchanged ones w.Write([]byte(model.MapToJson(member.NotifyProps))) } diff --git a/api/user.go b/api/user.go index b961aa609..e78b5be03 100644 --- a/api/user.go +++ b/api/user.go @@ -1398,6 +1398,8 @@ func updateUser(c *Context, w http.ResponseWriter, r *http.Request) { go sendEmailChangeUsername(c, rusers[1].Username, rusers[0].Username, rusers[0].Email, c.GetSiteURL()) } + InvalidateCacheForUser(user.Id) + updatedUser := rusers[0] updatedUser = sanitizeProfile(c, updatedUser) @@ -1955,6 +1957,7 @@ func updateUserNotify(c *Context, w http.ResponseWriter, r *http.Request) { return } else { c.LogAuditWithUserId(user.Id, "") + InvalidateCacheForUser(user.Id) ruser := result.Data.([2]*model.User)[0] options := utils.Cfg.GetSanitizeOptions() diff --git a/api/web_hub.go b/api/web_hub.go index 73b94bf1d..b607703f2 100644 --- a/api/web_hub.go +++ b/api/web_hub.go @@ -112,6 +112,7 @@ func InvalidateCacheForUser(userId string) { func InvalidateCacheForUserSkipClusterSend(userId string) { Srv.Store.Channel().InvalidateAllChannelMembersForUser(userId) + Srv.Store.User().InvalidateProfilesInChannelCacheByUser(userId) GetHubForUserId(userId).InvalidateUser(userId) } |