From bbe30f689c97de29f6e0aa1a853db709877eab2e Mon Sep 17 00:00:00 2001 From: prozacx Date: Tue, 21 Mar 2006 03:32:20 +0000 Subject: [PATCH] Added concept of default channels that a user is automatically joined to every time they attach git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@707 726aef4b-f618-498e-8847-2d620e286838 --- modules/partyline.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/partyline.cpp b/modules/partyline.cpp index 6c09c625..cc07b39a 100644 --- a/modules/partyline.cpp +++ b/modules/partyline.cpp @@ -29,6 +29,14 @@ public: } } + CString sChan; + unsigned int a = 0; + while (!(sChan = sArgs.Token(a++)).empty()) { + if (sChan.Left(2) == "~#") { + m_ssDefaultChans.insert(sChan); + } + } + return true; } @@ -77,6 +85,11 @@ public: m_pClient->PutClient(":" + m_pUser->GetIRCServer() + " 005 " + m_pUser->GetIRCNick().GetNick() + " CHANTYPES=" + m_pUser->GetChanPrefixes() + "~ :are supported by this server."); } + // Make sure this user is in the default channels + for (set::iterator a = m_ssDefaultChans.begin(); a != m_ssDefaultChans.end(); a++) { + m_msChans[*a].insert(m_pUser->GetUserName()); + } + for (map >::iterator it = m_msChans.begin(); it != m_msChans.end(); it++) { set& ssNicks = it->second; @@ -316,6 +329,7 @@ public: private: map > m_msChans; set m_spInjectedPrefixes; + set m_ssDefaultChans; }; GLOBALMODULEDEFS(CPartylineMod, "Internal channels and queries for users connected to znc");