diff --git a/Server.cpp b/Server.cpp index 03e90022..4a4536d3 100644 --- a/Server.cpp +++ b/Server.cpp @@ -34,6 +34,7 @@ unsigned short CServer::GetPort() const { return m_uPort; } const CString& CServer::GetPass() const { return m_sPass; } bool CServer::IsSSL() const { return m_bSSL; } -CString CServer::GetString() const { - return m_sName + " " + CString(m_bSSL ? "+" : "") + CString(m_uPort) + CString(m_sPass.empty() ? "" : " " + m_sPass); +CString CServer::GetString(bool bIncludePassword) const { + return m_sName + " " + CString(m_bSSL ? "+" : "") + CString(m_uPort) + + CString(bIncludePassword ? (m_sPass.empty() ? "" : " " + m_sPass) : ""); } diff --git a/Server.h b/Server.h index 716df31d..01b1242c 100644 --- a/Server.h +++ b/Server.h @@ -20,7 +20,7 @@ public: unsigned short GetPort() const; const CString& GetPass() const; bool IsSSL() const; - CString GetString() const; + CString GetString(bool bIncludePassword = true) const; static bool IsValidHostName(const CString& sHostName); private: protected: diff --git a/znc.cpp b/znc.cpp index 62a66345..e78d6cd0 100644 --- a/znc.cpp +++ b/znc.cpp @@ -144,8 +144,8 @@ bool CZNC::ConnectUser(CUser *pUser) { m_sConnectThrottle.AddItem(pServer->GetName()); - DEBUG("User [" << pUser->GetUserName() << "] is connecting to [" << pServer->GetName() << " " << pServer->GetPort() << "] ..."); - pUser->PutStatus("Attempting to connect to [" + pServer->GetName() + " " + CString(pServer->GetPort()) + "] ..."); + DEBUG("User [" << pUser->GetUserName() << "] is connecting to [" << pServer->GetString(false) << "] ..."); + pUser->PutStatus("Attempting to connect to [" + pServer->GetString(false) + "] ..."); pIRCSock = new CIRCSock(pUser); pIRCSock->SetPass(pServer->GetPass());