Added OnIRCRegistration(). Patch from Freman. Thanks :)

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1271 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
silverleo
2008-11-24 17:56:34 +00:00
parent f4e36a0b17
commit c71565103c
5 changed files with 24 additions and 4 deletions
+11 -4
View File
@@ -805,12 +805,19 @@ void CIRCSock::Connected() {
DEBUG_ONLY(cout << GetSockName() << " == Connected()" << endl);
m_pUser->IRCConnected(this);
if (!m_sPass.empty()) {
PutIRC("PASS " + m_sPass);
CString sPass = m_sPass;
CString sNick = m_pUser->GetNick();
CString sIdent = m_pUser->GetIdent();
CString sRealName = m_pUser->GetRealName();
MODULECALL(OnIRCRegistration(sPass, sNick, sIdent, sRealName), m_pUser, NULL, return);
if (!sPass.empty()) {
PutIRC("PASS " + sPass);
}
PutIRC("NICK " + m_pUser->GetNick());
PutIRC("USER " + m_pUser->GetIdent() + " \"" + m_pUser->GetIdent() + "\" \"" + m_pUser->GetIdent() + "\" :" + m_pUser->GetRealName());
PutIRC("NICK " + sNick);
PutIRC("USER " + sIdent + " \"" + sIdent + "\" \"" + sIdent + "\" :" + sRealName);
}
void CIRCSock::Disconnected() {
+2
View File
@@ -448,6 +448,7 @@ void CModule::OnPreRehash() {}
void CModule::OnPostRehash() {}
void CModule::OnIRCDisconnected() {}
void CModule::OnIRCConnected() {}
CModule::EModRet CModule::OnIRCRegistration(CString& sPass, CString& sNick, CString& sIdent, CString& sRealName) { return CONTINUE; }
CModule::EModRet CModule::OnBroadcast(CString& sMessage) { return CONTINUE; }
CModule::EModRet CModule::OnDCCUserSend(const CNick& RemoteNick, unsigned long uLongIP, unsigned short uPort, const CString& sFile, unsigned long uFileSize) { return CONTINUE; }
@@ -580,6 +581,7 @@ bool CModules::OnBoot() {
bool CModules::OnPreRehash() { MODUNLOADCHK(OnPreRehash()); return false; }
bool CModules::OnPostRehash() { MODUNLOADCHK(OnPostRehash()); return false; }
bool CModules::OnIRCConnected() { MODUNLOADCHK(OnIRCConnected()); return false; }
bool CModules::OnIRCRegistration(CString& sPass, CString& sNick, CString& sIdent, CString& sRealName) { MODHALTCHK(OnIRCRegistration(sPass, sNick, sIdent, sRealName)); }
bool CModules::OnBroadcast(CString& sMessage) { MODHALTCHK(OnBroadcast(sMessage)); }
bool CModules::OnIRCDisconnected() { MODUNLOADCHK(OnIRCDisconnected()); return false; }
bool CModules::OnDCCUserSend(const CNick& RemoteNick, unsigned long uLongIP, unsigned short uPort, const CString& sFile, unsigned long uFileSize) { MODHALTCHK(OnDCCUserSend(RemoteNick, uLongIP, uPort, sFile, uFileSize)); }
+2
View File
@@ -229,6 +229,7 @@ public:
virtual void OnPostRehash();
virtual void OnIRCDisconnected();
virtual void OnIRCConnected();
virtual EModRet OnIRCRegistration(CString& sPass, CString& sNick, CString& sIdent, CString& sRealName);
virtual EModRet OnBroadcast(CString& sMessage);
virtual EModRet OnDCCUserSend(const CNick& RemoteNick, unsigned long uLongIP, unsigned short uPort, const CString& sFile, unsigned long uFileSize);
@@ -372,6 +373,7 @@ public:
virtual bool OnPostRehash();
virtual bool OnIRCDisconnected();
virtual bool OnIRCConnected();
virtual bool OnIRCRegistration(CString& sPass, CString& sNick, CString& sIdent, CString& sRealName);
virtual bool OnBroadcast(CString& sMessage);
virtual bool OnDCCUserSend(const CNick& RemoteNick, unsigned long uLongIP, unsigned short uPort, const CString& sFile, unsigned long uFileSize);
+4
View File
@@ -333,6 +333,10 @@ public:
virtual EModRet OnUserRaw(CString& sLine) { return(CBSingle("OnUserRaw", sLine)); }
virtual EModRet OnRaw(CString& sLine) { return(CBSingle("OnRaw", sLine)); }
virtual EModRet OnIRCRegistration(CString& sPass, CString& sNick, CString& sIdent, CString& sRealName) {
return(CBFour("OnIRCRegistration", sPass, sNick, sIdent, sRealName));
}
virtual void OnModCommand(const CString& sCommand)
{
if (CBSingle("OnModCommand", sCommand) == 0)
+5
View File
@@ -52,6 +52,11 @@ public:
PutModule("You got disconnected BoyOh.");
}
virtual EModRet OnIRCRegistration(CString& sPass, CString& sNick, CString& sIdent, CString& sRealName) {
sRealName += " - ZNC";
return CONTINUE;
}
virtual EModRet OnBroadcast(CString& sMessage) {
PutModule("------ [" + sMessage + "]");
sMessage = "======== [" + sMessage + "] ========";