@ -99,14 +99,14 @@ func (s *Server) Addclient(conn *websocket.Conn, user *user.User, accessToken st
@@ -99,14 +99,14 @@ func (s *Server) Addclient(conn *websocket.Conn, user *user.User, accessToken st
s . mu . Lock ( )
{
client . i d = s . seq
s . clients [ client . i d] = client
client . I d = s . seq
s . clients [ client . I d] = client
s . seq ++
_lastSeenCache [ user . ID ] = time . Now ( )
}
s . mu . Unlock ( )
log . Traceln ( "Adding client" , client . i d, "total count:" , len ( s . clients ) )
log . Traceln ( "Adding client" , client . I d, "total count:" , len ( s . clients ) )
go client . writePump ( )
go client . readPump ( )
@ -132,7 +132,7 @@ func (s *Server) sendUserJoinedMessage(c *Client) {
@@ -132,7 +132,7 @@ func (s *Server) sendUserJoinedMessage(c *Client) {
userJoinedEvent := events . UserJoinedEvent { }
userJoinedEvent . SetDefaults ( )
userJoinedEvent . User = c . User
userJoinedEvent . ClientID = c . i d
userJoinedEvent . ClientID = c . I d
if err := s . Broadcast ( userJoinedEvent . GetBroadcastPayload ( ) ) ; err != nil {
log . Errorln ( "error adding client to chat server" , err )
@ -148,9 +148,9 @@ func (s *Server) ClientClosed(c *Client) {
@@ -148,9 +148,9 @@ func (s *Server) ClientClosed(c *Client) {
defer s . mu . Unlock ( )
c . close ( )
if _ , ok := s . clients [ c . i d] ; ok {
log . Debugln ( "Deleting" , c . i d)
delete ( s . clients , c . i d)
if _ , ok := s . clients [ c . I d] ; ok {
log . Debugln ( "Deleting" , c . I d)
delete ( s . clients , c . I d)
}
}