mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Fix sanitization on websocket user edit events. (#8551)
This commit is contained in:
committed by
Harrison Healey
parent
42c9170444
commit
6fcdf4abc6
10
app/user.go
10
app/user.go
@@ -940,7 +940,7 @@ func (a *App) UpdateActive(user *model.User, active bool) (*model.User, *model.A
|
||||
}
|
||||
}
|
||||
|
||||
a.sendUpdatedUserEvent(*ruser, false)
|
||||
a.sendUpdatedUserEvent(*ruser)
|
||||
|
||||
return ruser, nil
|
||||
}
|
||||
@@ -962,7 +962,7 @@ func (a *App) UpdateUserAsUser(user *model.User, asAdmin bool) (*model.User, *mo
|
||||
return nil, err
|
||||
}
|
||||
|
||||
a.sendUpdatedUserEvent(*updatedUser, asAdmin)
|
||||
a.sendUpdatedUserEvent(*updatedUser)
|
||||
|
||||
return updatedUser, nil
|
||||
}
|
||||
@@ -980,7 +980,7 @@ func (a *App) PatchUser(userId string, patch *model.UserPatch, asAdmin bool) (*m
|
||||
return nil, err
|
||||
}
|
||||
|
||||
a.sendUpdatedUserEvent(*updatedUser, asAdmin)
|
||||
a.sendUpdatedUserEvent(*updatedUser)
|
||||
|
||||
return updatedUser, nil
|
||||
}
|
||||
@@ -1009,8 +1009,8 @@ func (a *App) UpdateUserAuth(userId string, userAuth *model.UserAuth) (*model.Us
|
||||
return userAuth, nil
|
||||
}
|
||||
|
||||
func (a *App) sendUpdatedUserEvent(user model.User, asAdmin bool) {
|
||||
a.SanitizeProfile(&user, asAdmin)
|
||||
func (a *App) sendUpdatedUserEvent(user model.User) {
|
||||
a.SanitizeProfile(&user, false)
|
||||
|
||||
message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_USER_UPDATED, "", "", "", nil)
|
||||
message.Add("user", user)
|
||||
|
||||
Reference in New Issue
Block a user