]> jfr.im git - irc/rizon/znc.git/commitdiff
Fix stickychan to work with disabled channels (e.g. after a kick)
authorpsychon <redacted>
Fri, 3 Oct 2008 12:53:39 +0000 (12:53 +0000)
committerpsychon <redacted>
Fri, 3 Oct 2008 12:53:39 +0000 (12:53 +0000)
This kinda turns stickychan into kickrejoin... well, so what?

Thanks to Julian for reporting this.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1238 726aef4b-f618-498e-8847-2d620e286838

modules/stickychan.cpp

index 754bd7fe9c6c1c22c4a24083f28a1f8da9bcd9a4..f076dc4957211daae35dd1fbcfe587305bca6ee9 100644 (file)
@@ -78,14 +78,17 @@ public:
        {
                for (MCString::iterator it = BeginNV(); it != EndNV(); it++)
                {
-                       if (!m_pUser->FindChan(it->first))
-                       {
-                               CChan *pChan = new CChan(it->first, m_pUser, true);
+                       CChan *pChan = m_pUser->FindChan(it->first);
+                       if (!pChan) {
+                               pChan = new CChan(it->first, m_pUser, true);
                                if (!it->second.empty())
                                        pChan->SetKey(it->second);
                                m_pUser->AddChan(pChan);
-                               PutModule("Joining [" + it->first + "]");
-                               PutIRC("JOIN " + it->first + (it->second.empty() ? "" : it->second));
+                       }
+                       if (!pChan->IsOn()) {
+                               PutModule("Joining [" + pChan->GetName() + "]");
+                               PutIRC("JOIN " + pChan->GetName() + (pChan->GetKey().empty()
+                                                       ? "" : " " + pChan->GetKey()));
                        }
                }
        }