Main part is: Add disconnect and connect to *status

Other stuff included here:
- Always send the quit message when disconnecting from IRC
- Partly rewrite CConnectUserTimer::RunJob() for some de-uglification


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@874 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2007-11-16 22:37:27 +00:00
parent 5938a30d01
commit d78369fee0
6 changed files with 63 additions and 20 deletions
+10 -5
View File
@@ -55,12 +55,17 @@ CIRCSock::~CIRCSock() {
CZNC::Get().ReleaseISpoof();
}
PutIRC("QUIT :" + m_pUser->GetQuitMsg());
Quit();
m_msChans.clear();
GetUser()->AddBytesRead(GetBytesRead());
GetUser()->AddBytesWritten(GetBytesWritten());
}
void CIRCSock::Quit() {
PutIRC("QUIT :" + m_pUser->GetQuitMsg());
Close(CLT_AFTERWRITE);
}
void CIRCSock::ReadLine(const CString& sData) {
CString sLine = sData;
@@ -195,14 +200,14 @@ void CIRCSock::ReadLine(const CString& sData) {
} else {
char cLetter = 0;
if (sBadNick.empty()) {
Close();
Quit();
return;
}
cLetter = sBadNick.Right(1)[0];
if (cLetter == 'z') {
Close();
Quit();
return;
}
@@ -897,8 +902,8 @@ void CIRCSock::Disconnected() {
MODULECALL(OnIRCDisconnected(), m_pUser, NULL, );
DEBUG_ONLY(cout << GetSockName() << " == Disconnected()" << endl);
if (!m_pUser->IsBeingDeleted()) {
m_pUser->PutStatus("Disconnected from IRC. Reconnecting...");
if (!m_pUser->IsBeingDeleted() && m_pUser->GetIRCConnectEnabled()) {
m_pUser->PutStatus("Disconnected from IRC. Reconnecting...");
}
m_pUser->ClearRawBuffer();
m_pUser->ClearMotdBuffer();