Permalink
Browse files

Use the module save path for dcc's, and remove DLPath since it is no …

…longer used.
  • Loading branch information...
Kyle Fuller
Kyle Fuller committed May 31, 2011
1 parent 16047ea commit c635caeab2e8012cfe501dbfa2d06bd5ad9a80e4
Showing with 5 additions and 9 deletions.
  1. +1 −3 User.cpp
  2. +0 −2 User.h
  3. +4 −4 modules/extra/dcc.cpp
View
@@ -52,9 +52,8 @@ class CUserTimer : public CCron {
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
View
2 User.h
@@ -190,7 +190,6 @@ class CUser {
bool IsChan(const CString& sChan) const;
const CString& GetUserPath() const;
- const CString& GetDLPath() const;
bool DenyLoadMod() const;
bool IsAdmin() const;
@@ -245,7 +244,6 @@ class CUser {
// Paths
CString m_sUserPath;
- CString m_sDLPath;
// !Paths
CBuffer m_RawBuffer;
View
@@ -89,7 +89,7 @@ class CDCCMod : public CModule {
#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 @@ class CDCCMod : public CModule {
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 @@ class CDCCMod : public CModule {
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 @@ class CDCCMod : public CModule {
}
} 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));
}

0 comments on commit c635cae

Please sign in to comment.