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:
1 parent
3ceae3ad26
commit
a0d58c8fed
6 files changed
+154
-5
No files matched your search
+2
-2
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user