mirror of
https://github.com/znc/znc.git
synced 2026-04-30 10:34:16 +02:00
Use the module save path for dcc's, and remove DLPath since it is no longer used.
This commit is contained in:
4
User.cpp
4
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
|
||||
|
||||
2
User.h
2
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;
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user