From 9c1f2ee462df4fe78c3e86ac19ee9d0142f357b4 Mon Sep 17 00:00:00 2001 From: psychon Date: Fri, 5 Jun 2009 19:56:23 +0000 Subject: [PATCH] stickychan: Accept a channel list as module arguments If you now load stickychan with "#chan1,#chan2 bla" as its argument, both channels are stuck where "bla" is the channel key for #chan2. Thanks to FB-eYe for the suggestion. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1534 726aef4b-f618-498e-8847-2d620e286838 --- modules/stickychan.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/stickychan.cpp b/modules/stickychan.cpp index ade0d009..b079daa4 100644 --- a/modules/stickychan.cpp +++ b/modules/stickychan.cpp @@ -112,6 +112,19 @@ static void RunTimer(CModule * pModule, CFPTimer *pTimer) bool CStickyChan::OnLoad(const CString& sArgs, CString& sMessage) { + VCString vsChans; + VCString::iterator it; + sArgs.Split(",", vsChans, false); + + for (it = vsChans.begin(); it != vsChans.end(); it++) { + CString sChan = it->Token(0); + CString sKey = it->Token(1, true); + SetNV(sChan, sKey); + } + + // Since we now have these channels added, clear the argument list + SetArgs(""); + AddTimer(RunTimer, "StickyChanTimer", 15); return(true); }