mirror of
https://github.com/owncast/owncast.git
synced 2025-01-30 03:53:50 +03:00
fix(chat): do not send chat join message
If a user is already connected to chat from elsewhere, do not send an additional chat join message. Closes #3487
This commit is contained in:
parent
19f257151e
commit
ebf64dd17d
1 changed files with 7 additions and 0 deletions
|
@ -96,6 +96,13 @@ func (s *Server) Addclient(conn *websocket.Conn, user *user.User, accessToken st
|
|||
|
||||
shouldSendJoinedMessages := data.GetChatJoinPartMessagesEnabled()
|
||||
|
||||
// If there are existing clients connected for this user do not send
|
||||
// a user joined message. Do not put this under a mutex, as
|
||||
// GetClientsForUser already has a lock.
|
||||
if existingConnectedClients, _ := GetClientsForUser(user.ID); len(existingConnectedClients) > 0 {
|
||||
shouldSendJoinedMessages = false
|
||||
}
|
||||
|
||||
s.mu.Lock()
|
||||
{
|
||||
// If there is a pending disconnect timer then clear it.
|
||||
|
|
Loading…
Add table
Reference in a new issue