diff --git a/User.cpp b/User.cpp index e0db1cb5..41c26063 100644 --- a/User.cpp +++ b/User.cpp @@ -52,9 +52,8 @@ protected: CUser::CUser(const CString& sUserName) : m_sUserName(sUserName), m_sCleanUserName(MakeCleanUserName(sUserName)) { - // set paths that depend on the user name: + // set path that depends on the user name: m_sUserPath = CZNC::Get().GetUserPath() + "/" + m_sUserName; - m_sDLPath = m_sUserPath + "/downloads"; m_pIRCSock = NULL; m_fTimezoneOffset = 0; @@ -1447,5 +1446,4 @@ bool CUser::KeepBuffer() const { return m_bKeepBuffer; } //CString CUser::GetSkinName() const { return (!m_sSkinName.empty()) ? m_sSkinName : CZNC::Get().GetSkinName(); } CString CUser::GetSkinName() const { return m_sSkinName; } const CString& CUser::GetUserPath() const { if (!CFile::Exists(m_sUserPath)) { CDir::MakeDir(m_sUserPath); } return m_sUserPath; } -const CString& CUser::GetDLPath() const { if (!CFile::Exists(m_sDLPath)) { CDir::MakeDir(m_sDLPath); } return m_sDLPath; } // !Getters diff --git a/User.h b/User.h index 4637e419..aa8b7e97 100644 --- a/User.h +++ b/User.h @@ -190,7 +190,6 @@ public: bool IsChan(const CString& sChan) const; const CString& GetUserPath() const; - const CString& GetDLPath() const; bool DenyLoadMod() const; bool IsAdmin() const; @@ -245,7 +244,6 @@ protected: // Paths CString m_sUserPath; - CString m_sDLPath; // !Paths CBuffer m_RawBuffer; diff --git a/modules/extra/dcc.cpp b/modules/extra/dcc.cpp index e23479bc..a741022f 100644 --- a/modules/extra/dcc.cpp +++ b/modules/extra/dcc.cpp @@ -89,7 +89,7 @@ public: #endif bool SendFile(const CString& sRemoteNick, const CString& sFileName) { - CString sFullPath = CDir::ChangeDir(m_pUser->GetDLPath(), sFileName, CZNC::Get().GetHomePath()); + CString sFullPath = CDir::ChangeDir(GetSavePath(), sFileName, CZNC::Get().GetHomePath()); CDCCSock* pSock = new CDCCSock(this, sRemoteNick, sFullPath); CFile* pFile = pSock->OpenFile(false); @@ -138,7 +138,7 @@ public: void SendCommand(const CString& sLine) { CString sToNick = sLine.Token(1); CString sFile = sLine.Token(2); - CString sAllowedPath = m_pUser->GetDLPath(); + CString sAllowedPath = GetSavePath(); CString sAbsolutePath; if ((sToNick.empty()) || (sFile.empty())) { @@ -158,7 +158,7 @@ public: void GetCommand(const CString& sLine) { CString sFile = sLine.Token(1); - CString sAllowedPath = m_pUser->GetDLPath(); + CString sAllowedPath = GetSavePath(); CString sAbsolutePath; if (sFile.empty()) { @@ -234,7 +234,7 @@ public: } } else if (sMessage.Equals("DCC SEND ", false, 9)) { - CString sLocalFile = CDir::CheckPathPrefix(m_pUser->GetDLPath(), sMessage.Token(2)); + CString sLocalFile = CDir::CheckPathPrefix(GetSavePath(), sMessage.Token(2)); if (sLocalFile.empty()) { PutModule("Bad DCC file: " + sMessage.Token(2)); }