From 559030790978dc4323ee7273c7518934b418f413 Mon Sep 17 00:00:00 2001 From: psychon Date: Mon, 7 Apr 2008 20:19:17 +0000 Subject: [PATCH] chansaver: Add all channels to the config when this module is loaded git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1018 726aef4b-f618-498e-8847-2d620e286838 --- modules/chansaver.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/modules/chansaver.cpp b/modules/chansaver.cpp index d5def858..49db218a 100644 --- a/modules/chansaver.cpp +++ b/modules/chansaver.cpp @@ -13,7 +13,22 @@ class CChanSaverMod : public CModule { public: MODCONSTRUCTOR(CChanSaverMod) { + const vector& vChans = m_pUser->GetChans(); + vector::const_iterator it = vChans.begin(); + vector::const_iterator end = vChans.end(); + m_bWriteConf = false; + + for (; it != end; it++) { + CChan *pChan = *it; + + // If that channel isn't yet in the config, + // we'll have to add it... + if (!pChan->InConfig()) { + pChan->SetInConfig(true); + m_bWriteConf = true; + } + } } virtual ~CChanSaverMod() {