Added config option for bouncing dccs

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@388 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
prozacx
2005-06-14 06:25:36 +00:00
parent 0042cd911f
commit cc81e52203
5 changed files with 11 additions and 2 deletions
+1 -1
View File
@@ -626,7 +626,7 @@ bool CIRCSock::OnPrivCTCP(const CString& sNickMask, CString& sMessage) {
CString sVersionReply = m_pUser->GetVersionReply();
PutServ("NOTICE " + CNick(sNickMask).GetNick() + " :\001VERSION " + sVersionReply + "\001");
}
} else if (strncasecmp(sMessage.c_str(), "DCC ", 4) == 0) {
} else if (strncasecmp(sMessage.c_str(), "DCC ", 4) == 0 && m_pUser && m_pUser->BounceDCCs()) {
// DCC CHAT chat 2453612361 44592
CString sType = sMessage.Token(1);
CString sFile = sMessage.Token(2);
+3
View File
@@ -20,6 +20,7 @@ CUser::CUser(const CString& sUserName, CZNC* pZNC) {
#ifdef _MODULES
m_pModules = new CModules(pZNC);
#endif
m_bBounceDCCs = true;
m_bPassHashed = false;
m_bUseClientIP = false;
m_bKeepNick = false;
@@ -452,6 +453,7 @@ void CUser::SetIdent(const CString& s) { m_sIdent = s; }
void CUser::SetRealName(const CString& s) { m_sRealName = s; }
void CUser::SetVHost(const CString& s) { m_sVHost = s; }
void CUser::SetPass(const CString& s, bool bHashed) { m_sPass = s; m_bPassHashed = bHashed; }
void CUser::SetBounceDCCs(bool b) { m_bBounceDCCs = b; }
void CUser::SetUseClientIP(bool b) { m_bUseClientIP = b; }
void CUser::SetKeepNick(bool b) { m_bKeepNick = b; }
void CUser::SetDenyLoadMod(bool b) { m_bDenyLoadMod = b; }
@@ -529,6 +531,7 @@ CString CUser::GetPemLocation() const { return m_pZNC->GetPemLocation(); }
bool CUser::UseClientIP() const { return m_bUseClientIP; }
bool CUser::GetKeepNick() const { return m_bKeepNick; }
bool CUser::DenyLoadMod() const { return m_bDenyLoadMod; }
bool CUser::BounceDCCs() const { return m_bBounceDCCs; }
const CString& CUser::GetStatusPrefix() const { return m_sStatusPrefix; }
const CString& CUser::GetDefaultChanModes() const { return m_sDefaultChanModes; }
const vector<CChan*>& CUser::GetChans() const { return m_vChans; }
+3
View File
@@ -71,6 +71,7 @@ public:
void SetRealName(const CString& s);
void SetVHost(const CString& s);
void SetPass(const CString& s, bool bHashed);
void SetBounceDCCs(bool b);
void SetUseClientIP(bool b);
void SetKeepNick(bool b);
void SetDenyLoadMod(bool b);
@@ -109,6 +110,7 @@ public:
bool UseClientIP() const;
bool GetKeepNick() const;
bool DenyLoadMod() const;
bool BounceDCCs() const;
const CString& GetStatusPrefix() const;
const CString& GetDefaultChanModes() const;
const vector<CChan*>& GetChans() const;
@@ -145,6 +147,7 @@ protected:
CString m_sDLPath;
// !Paths
bool m_bBounceDCCs;
bool m_bPassHashed;
bool m_bUseClientIP;
bool m_bKeepNick;
+1 -1
View File
@@ -200,7 +200,7 @@ void CUserSock::ReadLine(const CString& sData) {
sCTCP.LeftChomp();
sCTCP.RightChomp();
if (strncasecmp(sCTCP.c_str(), "DCC ", 4) == 0) {
if (strncasecmp(sCTCP.c_str(), "DCC ", 4) == 0 && m_pUser && m_pUser->BounceDCCs()) {
CString sType = sCTCP.Token(1);
CString sFile = sCTCP.Token(2);
unsigned long uLongIP = strtoul(sCTCP.Token(3).c_str(), NULL, 10);
+3
View File
@@ -697,6 +697,9 @@ bool CZNC::ParseConfig(const CString& sConfig) {
pUser->SetPass(sValue, false);
}
continue;
} else if (sName.CaseCmp("BounceDCCs") == 0) {
pUser->SetBounceDCCs(sValue.CaseCmp("true") == 0);
continue;
} else if (sName.CaseCmp("AutoCycle") == 0) {
bAutoCycle = (sValue.CaseCmp("true") == 0);