Skip to content

Commit 6a27126

Browse files
committed
Minor updates from review comments
1 parent 4b56a8c commit 6a27126

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

src/client.cpp

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,10 @@ void CClient::OnMuteStateHasChangedReceived ( int iServerChanID, bool bIsMuted )
286286
// map iChanID from server channel ID to client channel ID
287287
int iChanID = FindClientChannel ( iServerChanID, false );
288288

289-
emit MuteStateHasChangedReceived ( iChanID, bIsMuted );
289+
if ( iChanID != INVALID_INDEX )
290+
{
291+
emit MuteStateHasChangedReceived ( iChanID, bIsMuted );
292+
}
290293
}
291294

292295
void CClient::OnCLChannelLevelListReceived ( CHostAddress InetAddr, CVector<uint16_t> vecLevelList )
@@ -321,8 +324,9 @@ void CClient::OnConClientListMesReceived ( CVector<CChannelInfo> vecChanInfo )
321324
// server channel ID of this entry
322325
const int iServerChannelID = vecChanInfo[i].iChanID;
323326

324-
// find matching client channel ID, creating new if necessary
325-
const int iClientChannelID = FindClientChannel ( iServerChannelID, true );
327+
// find matching client channel ID, creating new if necessary,
328+
// update channel number to be client-side
329+
vecChanInfo[i].iChanID = FindClientChannel ( iServerChannelID, true );
326330

327331
// discard any lower server channels that are no longer in our local list
328332
while ( iSrvIdx < iServerChannelID )
@@ -337,10 +341,8 @@ void CClient::OnConClientListMesReceived ( CVector<CChannelInfo> vecChanInfo )
337341
iSrvIdx++;
338342
}
339343

340-
// now should have matching server channel IDs
341-
vecChanInfo[i].iChanID = iClientChannelID; // update channel number to be client-side
342-
i++; // next list entry
343-
iSrvIdx++; // next local server channel
344+
i++; // next list entry
345+
iSrvIdx++; // next local server channel
344346
}
345347

346348
// have now run out of active channels, discard any remaining from our local list
@@ -1476,7 +1478,7 @@ void CClient::ClearClientChannels()
14761478
clientChannelIDs[i] = INVALID_INDEX;
14771479
}
14781480

1479-
qInfo() << "> Client channel list cleared";
1481+
// qInfo() << "> Client channel list cleared";
14801482
}
14811483

14821484
void CClient::FreeClientChannel ( const int iServerChannelID )
@@ -1497,10 +1499,12 @@ void CClient::FreeClientChannel ( const int iServerChannelID )
14971499

14981500
iActiveChannels -= 1;
14991501

1502+
/*
15001503
qInfo() << qUtf8Printable ( QString ( "> Freed client ch %1 for server ch %2; chan count = %3" )
15011504
.arg ( iClientChannelID )
15021505
.arg ( iServerChannelID )
15031506
.arg ( iActiveChannels ) );
1507+
*/
15041508
}
15051509

15061510
// find, and optionally create, a client channel for the supplied server channel ID
@@ -1544,10 +1548,12 @@ int CClient::FindClientChannel ( const int iServerChannelID, const bool bCreateI
15441548

15451549
iActiveChannels += 1;
15461550

1551+
/*
15471552
qInfo() << qUtf8Printable ( QString ( "> Alloc client ch %1 for server ch %2; chan count = %3" )
15481553
.arg ( iClientChannelID )
15491554
.arg ( iServerChannelID )
15501555
.arg ( iActiveChannels ) );
1556+
*/
15511557

15521558
return iClientChannelID; // new client channel ID
15531559
}

0 commit comments

Comments
 (0)