From 5c28adf4ce565616c7b682cbe0e8d1bb46412d65 Mon Sep 17 00:00:00 2001 From: psychon Date: Thu, 31 Dec 2009 12:28:59 +0000 Subject: [PATCH] User: Have correct save and dl path after Clone() Without this, after you cloned a user via e.g. the admin modul, it would still write to the datadir of the old user. Patch by flakes, thanks a lot. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1686 726aef4b-f618-498e-8847-2d620e286838 --- User.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/User.cpp b/User.cpp index 43e7eaf9..f7e3a5b7 100644 --- a/User.cpp +++ b/User.cpp @@ -51,8 +51,6 @@ CUser::CUser(const CString& sUserName) { m_bIRCConnectEnabled = true; m_pUserTimer = new CUserTimer(this); CZNC::Get().GetManager().AddCron(m_pUserTimer); - m_sUserPath = CZNC::Get().GetUserPath() + "/" + sUserName; - m_sDLPath = GetUserPath() + "/downloads"; } CUser::~CUser() { @@ -1113,6 +1111,10 @@ CString CUser::MakeCleanUserName(const CString& sUserName) { void CUser::SetUserName(const CString& s) { m_sCleanUserName = CUser::MakeCleanUserName(s); m_sUserName = s; + + // set paths that depend on the user name: + m_sUserPath = CZNC::Get().GetUserPath() + "/" + m_sUserName; + m_sDLPath = GetUserPath() + "/downloads"; } bool CUser::IsChan(const CString& sChan) const {