From 90896da6a7dec2fd355ef54a3d5d078b42d4e21c Mon Sep 17 00:00:00 2001 From: Kyle Fuller Date: Wed, 21 Mar 2012 21:57:56 +0000 Subject: [PATCH] ResetJoinTries once we enable a channel Fixes #83 --- Chan.cpp | 5 +++++ Chan.h | 2 +- IRCSock.cpp | 1 - 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Chan.cpp b/Chan.cpp index 5f1a94fe..157f4d49 100644 --- a/Chan.cpp +++ b/Chan.cpp @@ -605,3 +605,8 @@ void CChan::SendBuffer(CClient* pClient) { } } } + +void CChan::Enable() { + ResetJoinTries(); + m_bDisabled = false; +} diff --git a/Chan.h b/Chan.h index 2845e9ae..8d979ca2 100644 --- a/Chan.h +++ b/Chan.h @@ -113,7 +113,7 @@ public: void SetInConfig(bool b) { m_bInConfig = b; } void SetCreationDate(unsigned long u) { m_ulCreationDate = u; } void Disable() { m_bDisabled = true; } - void Enable() { m_bDisabled = false; } + void Enable(); void IncJoinTries() { m_uJoinTries++; } void ResetJoinTries() { m_uJoinTries = 0; } // !Setters diff --git a/IRCSock.cpp b/IRCSock.cpp index d31830e8..d9fda7b3 100644 --- a/IRCSock.cpp +++ b/IRCSock.cpp @@ -469,7 +469,6 @@ void CIRCSock::ReadLine(const CString& sData) { m_pUser->AddChan(sChan, false); pChan = m_pUser->FindChan(sChan); if (pChan) { - pChan->ResetJoinTries(); pChan->Enable(); pChan->SetIsOn(true); PutIRC("MODE " + sChan);