diff --git a/IRCSock.cpp b/IRCSock.cpp index 60127518..6f4da39d 100644 --- a/IRCSock.cpp +++ b/IRCSock.cpp @@ -782,6 +782,8 @@ void CIRCSock::Disconnected() { if (!m_pUser->IsBeingDeleted()) { m_pUser->PutStatus("Disconnected from IRC. Reconnecting..."); } + + ResetChans(); } void CIRCSock::SockError(int iErrno) { @@ -789,6 +791,8 @@ void CIRCSock::SockError(int iErrno) { if (!m_pUser->IsBeingDeleted()) { m_pUser->PutStatus("Disconnected from IRC. Reconnecting..."); } + + ResetChans(); } void CIRCSock::Timeout() { @@ -796,6 +800,8 @@ void CIRCSock::Timeout() { if (!m_pUser->IsBeingDeleted()) { m_pUser->PutStatus("IRC connection timed out. Reconnecting..."); } + + ResetChans(); } void CIRCSock::ConnectionRefused() { @@ -870,3 +876,9 @@ CIRCSock::EChanModeArgs CIRCSock::GetModeType(unsigned char uMode) const { return it->second; } +void CIRCSock::ResetChans() { + for (map::iterator a = m_msChans.begin(); a != m_msChans.end(); a++) { + a->second->Reset(); + } +} + diff --git a/IRCSock.h b/IRCSock.h index fe3f0123..4a5b9515 100644 --- a/IRCSock.h +++ b/IRCSock.h @@ -44,6 +44,7 @@ public: void KeepNick(bool bForce = false); void PutIRC(const CString& sLine); void ParseISupport(const CString& sLine); + void ResetChans(); // Setters void SetPass(const CString& s) { m_sPass = s; }