From 3b8b29e8a3070b9d17e3e61368d2b347709be7c5 Mon Sep 17 00:00:00 2001 From: prozacx Date: Sun, 10 Jul 2005 23:55:22 +0000 Subject: [PATCH] Added flag to CChan to tell whether chan is in the config or not git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@427 726aef4b-f618-498e-8847-2d620e286838 --- IRCSock.cpp | 2 +- modules/admin.cpp | 8 ++++++-- modules/stickychan.cpp | 2 +- znc.cpp | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/IRCSock.cpp b/IRCSock.cpp index 583486c3..a16a4508 100644 --- a/IRCSock.cpp +++ b/IRCSock.cpp @@ -442,7 +442,7 @@ void CIRCSock::ReadLine(const CString& sData) { } if (sNick.CaseCmp(GetNick()) == 0) { - m_pUser->AddChan(sChan); + m_pUser->AddChan(sChan, false); } CChan* pChan = m_pUser->FindChan(sChan); diff --git a/modules/admin.cpp b/modules/admin.cpp index 69f85a37..bd68c53e 100644 --- a/modules/admin.cpp +++ b/modules/admin.cpp @@ -246,7 +246,11 @@ bool CAdminSock::UserPage(CString& sPageRet, CUser* pUser) { const vector& vChans = pUser->GetChans(); for (unsigned int b = 0; b < vChans.size(); b++) { - sChans += vChans[b]->GetName() + "\r\n"; + CChan* pChan = vChans[b]; + + if (pChan->InConfig()) { + sChans += vChans[b]->GetName() + "\r\n"; + } } const MCString& msCTCPReplies = pUser->GetCTCPReplies(); for (MCString::const_iterator it2 = msCTCPReplies.begin(); it2 != msCTCPReplies.end(); it2++) { @@ -446,7 +450,7 @@ CUser* CAdminSock::GetNewUser(CString& sPageRet) { GetParam("channels").Split("\n", vsArgs); for (a = 0; a < vsArgs.size(); a++) { - pNewUser->AddChan(vsArgs[a].TrimRight_n("\r")); + pNewUser->AddChan(vsArgs[a].TrimRight_n("\r"), true); } return pNewUser; diff --git a/modules/stickychan.cpp b/modules/stickychan.cpp index 45e45dd0..6a19c37e 100644 --- a/modules/stickychan.cpp +++ b/modules/stickychan.cpp @@ -50,7 +50,7 @@ public: { if ( !m_pUser->FindChan( it->first ) ) { - CChan *pChan = new CChan( it->first, m_pUser ); + CChan *pChan = new CChan( it->first, m_pUser, true ); if ( !it->second.empty() ) pChan->SetKey( it->second ); m_pUser->AddChan( pChan ); diff --git a/znc.cpp b/znc.cpp index 7b98f19f..187f7111 100644 --- a/znc.cpp +++ b/znc.cpp @@ -690,7 +690,7 @@ bool CZNC::ParseConfig(const CString& sConfig) { return false; } - pChan = new CChan(sValue, pUser); + pChan = new CChan(sValue, pUser, true); continue; } } @@ -800,7 +800,7 @@ bool CZNC::ParseConfig(const CString& sConfig) { CUtils::PrintStatus(pUser->AddServer(sValue)); continue; } else if (sName.CaseCmp("Chan") == 0) { - pUser->AddChan(sValue); + pUser->AddChan(sValue, true); continue; } else if (sName.CaseCmp("LoadModule") == 0) { CString sModName = sValue.Token(0);