mirror of
https://github.com/znc/znc.git
synced 2026-07-28 20:43:34 +02:00
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:
+3
-1
@@ -30,6 +30,7 @@ CChan::CChan(const CString& sName, CIRCNetwork* pNetwork, bool bInConfig,
|
||||
CConfig* pConfig)
|
||||
: m_bDetached(false),
|
||||
m_bIsOn(false),
|
||||
m_bParting(false),
|
||||
m_bAutoClearChanBuffer(pNetwork->GetUser()->AutoClearChanBuffer()),
|
||||
m_bInConfig(bInConfig),
|
||||
m_bDisabled(false),
|
||||
@@ -84,6 +85,7 @@ CChan::~CChan() { ClearNicks(); }
|
||||
|
||||
void CChan::Reset() {
|
||||
m_bIsOn = false;
|
||||
m_bParting = false;
|
||||
m_bModeKnown = false;
|
||||
m_mcsModes.clear();
|
||||
m_sTopic = "";
|
||||
@@ -143,7 +145,7 @@ void CChan::JoinUser(const CString& sKey) {
|
||||
if (!IsOn() && !sKey.empty()) {
|
||||
SetKey(sKey);
|
||||
}
|
||||
if (m_pNetwork->IsIRCConnected() && !IsOn()) {
|
||||
if (m_pNetwork->IsIRCConnected() && (!IsOn() || IsParting())) {
|
||||
m_pNetwork->PutIRC("JOIN " + GetName() + " " + GetKey());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user