Browse files

Remove OnDCCUserSend module hook

  • Loading branch information...
1 parent 611e086 commit 0b360c010207c5543df251e2e962ed433226afee @kylef kylef committed Apr 2, 2011
View
2 Client.cpp
@@ -418,8 +418,6 @@ void CClient::ReadLine(const CString& sData) {
}
m_pUser->GetFile(GetNick(), CUtils::GetIP(uLongIP), uPort, sAbsolutePath, uFileSize);
- } else {
- MODULECALL(OnDCCUserSend(CString(m_pUser->GetStatusPrefix() + sTarget), uLongIP, uPort, sFile, uFileSize), m_pUser, this, return);
}
} else {
unsigned short uBNCPort = CDCCBounce::DCCRequest(sTarget, uLongIP, uPort, sFile, false, m_pUser, "");
View
3 Modules.cpp
@@ -473,8 +473,6 @@ void CModule::OnIRCConnectionError(CIRCSock *IRCSock) {}
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; }
-
void CModule::OnChanPermission(const CNick& OpNick, const CNick& Nick, CChan& Channel, unsigned char uMode, bool bAdded, bool bNoChange) {}
void CModule::OnOp(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange) {}
void CModule::OnDeop(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange) {}
@@ -634,7 +632,6 @@ bool CModules::OnIRCConnectionError(CIRCSock *pIRCSock) { MODUNLOADCHK(OnIRCConn
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)); }
bool CModules::OnChanPermission(const CNick& OpNick, const CNick& Nick, CChan& Channel, unsigned char uMode, bool bAdded, bool bNoChange) { MODUNLOADCHK(OnChanPermission(OpNick, Nick, Channel, uMode, bAdded, bNoChange)); return false; }
bool CModules::OnOp(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange) { MODUNLOADCHK(OnOp(OpNick, Nick, Channel, bNoChange)); return false; }
bool CModules::OnDeop(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange) { MODUNLOADCHK(OnDeop(OpNick, Nick, Channel, bNoChange)); return false; }
View
7 Modules.h
@@ -413,11 +413,6 @@ class CModule {
*/
virtual EModRet OnBroadcast(CString& sMessage);
- /** This module hook is called when a user sends a DCC SEND request to
- * your module fake-nickname.
- */
- virtual EModRet OnDCCUserSend(const CNick& RemoteNick, unsigned long uLongIP, unsigned short uPort, const CString& sFile, unsigned long uFileSize);
-
/** This module hook is called when a user mode on a channel changes.
* @param OpNick The nick who sent the mode change.
* @param Nick The nick whose channel mode changes.
@@ -894,8 +889,6 @@ class CModules : public vector<CModule*> {
bool OnIRCRegistration(CString& sPass, CString& sNick, CString& sIdent, CString& sRealName);
bool OnBroadcast(CString& sMessage);
- bool OnDCCUserSend(const CNick& RemoteNick, unsigned long uLongIP, unsigned short uPort, const CString& sFile, unsigned long uFileSize);
-
bool OnChanPermission(const CNick& OpNick, const CNick& Nick, CChan& Channel, unsigned char uMode, bool bAdded, bool bNoChange);
bool OnOp(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange);
bool OnDeop(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange);
View
14 modules/extra/shell.cpp
@@ -123,16 +123,14 @@ class CShellMod : public CModule {
}
}
- virtual EModRet OnDCCUserSend(const CNick& RemoteNick, unsigned long uLongIP, unsigned short uPort, const CString& sFile, unsigned long uFileSize) {
- if (RemoteNick.GetNick().Equals(GetModNick())) {
- CString sLocalFile = CDir::ChangeDir(m_sPath, sFile, CZNC::Get().GetHomePath());
-
+ virtual void OnModCTCP(const CString& sMessage) {
+ if (sMessage.Equals("DCC SEND ", false, 9)) {
+ CString sLocalFile = CDir::ChangeDir(m_sPath, sMessage.Token(2), CZNC::Get().GetHomePath());
+ unsigned long uLongIP = sMessage.Token(3).ToULong();
+ unsigned short uPort = sMessage.Token(4).ToUShort();
+ unsigned long uFileSize = sMessage.Token(5).ToULong();
m_pUser->GetFile(m_pUser->GetCurNick(), CUtils::GetIP(uLongIP), uPort, sLocalFile, uFileSize, GetModName());
-
- return HALT;
}
-
- return CONTINUE;
}
void PutShell(const CString& sMsg) {
View
1 modules/modperl/functions.in
@@ -13,7 +13,6 @@ EModRet OnIRCConnecting(CIRCSock *pIRCSock)
void OnIRCConnectionError(CIRCSock *pIRCSock)
EModRet OnIRCRegistration(CString& sPass, CString& sNick, CString& sIdent, CString& sRealName)
EModRet OnBroadcast(CString& sMessage)
-EModRet OnDCCUserSend(const CNick& RemoteNick, unsigned long uLongIP, unsigned short uPort, const CString& sFile, unsigned long uFileSize)
void OnChanPermission(const CNick& OpNick, const CNick& Nick, CChan& Channel, unsigned char uMode, bool bAdded, bool bNoChange)
void OnOp(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange)
void OnDeop(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange)
View
1 modules/modperl/module.h
@@ -36,7 +36,6 @@ class CPerlModule : public CModule {
virtual void OnIRCConnectionError(CIRCSock *pIRCSock);
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);
virtual void OnChanPermission(const CNick& OpNick, const CNick& Nick, CChan& Channel, unsigned char uMode, bool bAdded, bool bNoChange);
virtual void OnOp(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange);
virtual void OnDeop(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange);
View
1 modules/modperl/startup.pl
@@ -298,7 +298,6 @@ sub description {
sub OnIRCConnectionError {}
sub OnIRCRegistration {}
sub OnBroadcast {}
-sub OnDCCUserSend {}
sub OnChanPermission {}
sub OnOp {}
sub OnDeop {}
View
1 modules/modpython/functions.in
@@ -13,7 +13,6 @@ EModRet OnIRCConnecting(CIRCSock *pIRCSock)
void OnIRCConnectionError(CIRCSock *pIRCSock)
EModRet OnIRCRegistration(CString& sPass, CString& sNick, CString& sIdent, CString& sRealName)
EModRet OnBroadcast(CString& sMessage)
-EModRet OnDCCUserSend(const CNick& RemoteNick, unsigned long uLongIP, unsigned short uPort, const CString& sFile, unsigned long uFileSize)
void OnChanPermission(const CNick& OpNick, const CNick& Nick, CChan& Channel, unsigned char uMode, bool bAdded, bool bNoChange)
void OnOp(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange)
void OnDeop(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange)
View
1 modules/modpython/module.h
@@ -58,7 +58,6 @@ class CPyModule : public CModule {
virtual void OnIRCConnectionError(CIRCSock *pIRCSock);
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);
virtual void OnChanPermission(const CNick& OpNick, const CNick& Nick, CChan& Channel, unsigned char uMode, bool bAdded, bool bNoChange);
virtual void OnOp(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange);
virtual void OnDeop(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange);
View
4 modules/modpython/znc.py
@@ -221,9 +221,6 @@ def OnIRCRegistration(self, sPass, sNick, sIdent, sRealName):
def OnBroadcast(self, sMessage):
pass
- def OnDCCUserSend(self, RemoteNick, uLongIP, uPort, sFile, uFileSize):
- pass
-
def OnChanPermission(self, OpNick, Nick, Channel, uMode, bAdded,
bNoChange):
pass
@@ -366,7 +363,6 @@ def OnTimerAutoJoin(self, Channel):
def OnEmbeddedWebRequest(self, WebSock, sPageName, Tmpl):
pass
-
def make_inherit(cl, parent, attr):
def make_caller(parent, name, attr):
return lambda self, *a: parent.__dict__[name](self.__dict__[attr], *a)

0 comments on commit 0b360c0

Please sign in to comment.