diff --git a/src/llconclientdlg.cpp b/src/llconclientdlg.cpp index 2e149f95..27784a58 100755 --- a/src/llconclientdlg.cpp +++ b/src/llconclientdlg.cpp @@ -255,7 +255,7 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP, TimerStatus.start ( STATUSBAR_UPDATE_TIME ); } -void CLlconClientDlg::closeEvent ( QCloseEvent * Event ) +void CLlconClientDlg::closeEvent ( QCloseEvent* Event ) { // if settings dialog or chat dialog is open, close it ClientSettingsDlg.close(); diff --git a/src/server.cpp b/src/server.cpp index b67c4063..7d7818f6 100755 --- a/src/server.cpp +++ b/src/server.cpp @@ -528,29 +528,6 @@ void CServer::CreateAndSendChanListForAllConChannels() } } -void CServer::CreateAndSendChanListForAllExceptThisChan ( const int iCurChanID ) -{ - // create channel list - CVector vecChanInfo ( CreateChannelList() ); - - // now send connected channels list to all connected clients except for - // the channel with the ID "iCurChanID" - for ( int i = 0; i < USED_NUM_CHANNELS; i++ ) - { - if ( ( vecChannels[i].IsConnected() ) && ( i != iCurChanID ) ) - { - // send message - vecChannels[i].CreateConClientListMes ( vecChanInfo ); - } - } - - // create status HTML file if enabled - if ( bWriteStatusHTMLFile ) - { - WriteHTMLChannelList(); - } -} - void CServer::CreateAndSendChanListForThisChan ( const int iCurChanID ) { // create channel list @@ -573,13 +550,13 @@ void CServer::CreateAndSendChatTextForAllConChannels ( const int iCurChanID, vecChannels[iCurChanID].GetAddress().GetIpAddressStringNoLastByte(); } - // add name of the client at the beginning of the message text and use - // different colors, to get correct HTML, the "<" and ">" signs must be - // replaced by "<" and ">" + // add time and name of the client at the beginning of the message text and + // use different colors QString sCurColor = vstrChatColors[iCurChanID % vstrChatColors.Size()]; const QString strActualMessageText = - "<" + ChanName + - "> " + strChatText; + "(" + + QTime::currentTime().toString ( "hh:mm:ss AP" ) + ") " + ChanName + + " " + strChatText; // send chat text to all connected clients --------------------------------- @@ -723,10 +700,15 @@ bAudioOK = true; // be created after the received data has to be put to the // channel first so that this channel is marked as connected) // - // connected clients list is only send for new connected clients after - // request, only the already connected clients get the list - // automatically, because they don't know when new clients connect - CreateAndSendChanListForAllExceptThisChan ( iCurChanID ); + // Usually it is not required to send the channel list to the + // client currently connecting since it automatically requests + // the channel list on a new connection (as a result, he will + // usually get the list twice which has no impact on functionality + // but will only increase the network load a tiny little bit). But + // in case the client thinks he is still connected but the server + // was restartet, it is important that we send the channel list + // at this place. + CreateAndSendChanListForAllConChannels(); } } Mutex.unlock(); diff --git a/src/server.h b/src/server.h index 61c5c622..8c26f7b6 100755 --- a/src/server.h +++ b/src/server.h @@ -109,7 +109,6 @@ protected: int GetFreeChan(); CVector CreateChannelList(); void CreateAndSendChanListForAllConChannels(); - void CreateAndSendChanListForAllExceptThisChan ( const int iCurChanID ); void CreateAndSendChanListForThisChan ( const int iCurChanID ); void CreateAndSendChatTextForAllConChannels ( const int iCurChanID, const QString& strChatText ); void WriteHTMLChannelList();