Add IsParting() flag to track PART commands waiting IRCd response.

Fixes potential desync where ZNC marks channel as parted before server
confirms the PART, which could cause issues if the server never replies.

Add unittests and integration tests.
This commit is contained in:
RealKindOne committed 2026-07-21 03:24:38 -04:00
1 parent 3ceae3ad26
commit a0d58c8fed
6 files changed
+154 -5

No files matched your search

+2 -2
View File
@@ -1469,7 +1469,7 @@ bool CClient::OnJoinMessage(CJoinMessage& Message) {
if (pChan) {
if (pChan->IsDetached())
pChan->AttachUser(this);
else
else if (!pChan->IsOn() || pChan->IsParting())
pChan->JoinUser(sKey);
continue;
} else if (!sChannel.empty()) {
@@ -1592,7 +1592,7 @@ bool CClient::OnPartMessage(CPartMessage& Message) {
PutStatusNotice(t_f("Removing channel {1}")(sChan));
m_pNetwork->DelChan(sChan);
} else {
if (pChan) pChan->SetIsOn(false);
if (pChan) pChan->SetParting(true);
sChans += (sChans.empty()) ? sChan : CString("," + sChan);
}
}