diff --git a/app/user.go b/app/user.go index 56f2ef5b97..9d3a52da3b 100644 --- a/app/user.go +++ b/app/user.go @@ -917,6 +917,22 @@ func (a *App) UpdateActive(user *model.User, active bool) (*model.User, *model.A a.SetStatusOffline(ruser.Id, false) } + teamsForUser, err := a.GetTeamsForUser(user.Id) + if err != nil { + return nil, err + } + + for _, team := range teamsForUser { + channelsForUser, err := a.GetChannelsForUser(team.Id, user.Id) + if err != nil { + return nil, err + } + + for _, channel := range *channelsForUser { + a.InvalidateCacheForChannelMembers(channel.Id) + } + } + return ruser, nil } }