Skip to content

Commit 19a90e6

Browse files
committed
Route CLConnClientList depending on whether connected
1 parent 5a100b9 commit 19a90e6

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

src/client.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ CClient::CClient ( const quint16 iPortNumber,
147147

148148
QObject::connect ( &ConnLessProtocol, &CProtocol::CLTcpSupported, this, &CClient::OnCLTcpSupported );
149149

150-
QObject::connect ( &ConnLessProtocol, &CProtocol::CLConnClientsListMesReceived, this, &CClient::CLConnClientsListMesReceived );
150+
QObject::connect ( &ConnLessProtocol, &CProtocol::CLConnClientsListMesReceived, this, &CClient::OnCLConnClientsListMesReceived );
151151

152152
QObject::connect ( &ConnLessProtocol, &CProtocol::CLPingReceived, this, &CClient::OnCLPingReceived );
153153

@@ -1065,6 +1065,20 @@ void CClient::OnCLTcpSupported ( CHostAddress InetAddr, int iID )
10651065
}
10661066
}
10671067

1068+
void CClient::OnCLConnClientsListMesReceived ( CHostAddress InetAddr, CVector<CChannelInfo> vecChanInfo )
1069+
{
1070+
// test if we are receiving for the connect dialog or a connected session
1071+
qDebug() << Q_FUNC_INFO << "Channel.IsConnected() =" << Channel.IsConnected();
1072+
if ( Channel.IsConnected() )
1073+
{
1074+
OnConClientListMesReceived ( vecChanInfo ); // connected session
1075+
}
1076+
else
1077+
{
1078+
emit CLConnClientsListMesReceived ( InetAddr, vecChanInfo ); // connect dialog
1079+
}
1080+
}
1081+
10681082
void CClient::Start()
10691083
{
10701084
// init object

src/client.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,7 @@ protected slots:
467467
void OnMuteStateHasChangedReceived ( int iServerChanID, bool bIsMuted );
468468
void OnCLChannelLevelListReceived ( CHostAddress InetAddr, CVector<uint16_t> vecLevelList );
469469
void OnConClientListMesReceived ( CVector<CChannelInfo> vecChanInfo );
470+
void OnCLConnClientsListMesReceived ( CHostAddress InetAddr, CVector<CChannelInfo> vecChanInfo );
470471

471472
signals:
472473
void ConClientListMesReceived ( CVector<CChannelInfo> vecChanInfo );

0 commit comments

Comments
 (0)