Skip to content
Browse files

identfile: Improve the debug messages

The new debug messages allow us to see when the identfile is unlocked
  • Loading branch information...
1 parent 3c0e209 commit edaa20e59eabd8483b4043491ae499b9c920bb94 @kylef kylef committed Oct 7, 2011
Showing with 6 additions and 5 deletions.
  1. +6 −5 modules/identfile.cpp
View
11 modules/identfile.cpp
@@ -91,14 +91,18 @@ class CIdentFileModule : public CModule {
sData.Replace("%", m_pUser->GetIdent());
}
- DEBUG("Writing [" + sData + "] to ident spoof file [" + m_pISpoofLockFile->GetLongName() + "] for user [" + m_pUser->GetUserName() + "]");
+ DEBUG("Writing [" + sData + "] to ident spoof file [" + m_pISpoofLockFile->GetLongName() + "] for user/network [" + m_pUser->GetUserName() + "/" + m_pNetwork->GetName() + "]");
m_pISpoofLockFile->Write(sData + "\n");
return true;
}
void ReleaseISpoof() {
+ DEBUG("Releasing ident spoof for user/network [" + m_pUser->GetUserName() + "/" + m_pNetwork->GetName() + "]");
+
+ m_pIRCSock = NULL;
+
if (m_pISpoofLockFile != NULL) {
if (m_pISpoofLockFile->Seek(0) && m_pISpoofLockFile->Truncate()) {
m_pISpoofLockFile->Write(m_sOrigISpoof);
@@ -127,7 +131,7 @@ class CIdentFileModule : public CModule {
virtual EModRet OnIRCConnecting(CIRCSock *pIRCSock) {
if (m_pISpoofLockFile != NULL) {
DEBUG("Aborting connection, ident spoof lock file exists");
- PutModule("Aborting connection, another user is currently connecting and using the ident spoof file");
+ PutModule("Aborting connection, another user or network is currently connecting and using the ident spoof file");
return HALTCORE;
}
@@ -143,21 +147,18 @@ class CIdentFileModule : public CModule {
virtual void OnIRCConnected() {
if (m_pIRCSock == m_pNetwork->GetIRCSock()) {
- m_pIRCSock = NULL;
ReleaseISpoof();
}
}
virtual void OnIRCConnectionError(CIRCSock *pIRCSock) {
if (m_pIRCSock == pIRCSock) {
- m_pIRCSock = NULL;
ReleaseISpoof();
}
}
virtual void OnIRCDisconnected() {
if (m_pIRCSock == m_pNetwork->GetIRCSock()) {
- m_pIRCSock = NULL;
ReleaseISpoof();
}
}

0 comments on commit edaa20e

Please sign in to comment.
Something went wrong with that request. Please try again.