mirror of
https://github.com/owncast/owncast.git
synced 2024-11-21 20:28:15 +03:00
chat: check that a new username is different before sending out updates (#3162)
This commit is contained in:
parent
822de27cfd
commit
dfa3a2a273
1 changed files with 6 additions and 0 deletions
|
@ -63,6 +63,12 @@ func (s *Server) userNameChanged(eventData chatClientEvent) {
|
|||
savedUser := user.GetUserByToken(eventData.client.accessToken)
|
||||
oldName := savedUser.DisplayName
|
||||
|
||||
// Check that the new name is different from old.
|
||||
if proposedUsername == oldName {
|
||||
eventData.client.sendConnectedClientInfo()
|
||||
return
|
||||
}
|
||||
|
||||
// Save the new name
|
||||
if err := user.ChangeUsername(eventData.client.User.ID, proposedUsername); err != nil {
|
||||
log.Errorln("error changing username", err)
|
||||
|
|
Loading…
Reference in a new issue