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
This commit is contained in:
prozacx
2006-03-21 03:32:20 +00:00
parent 0a9fdb404d
commit bbe30f689c
+14
View File
@@ -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<CString>::iterator a = m_ssDefaultChans.begin(); a != m_ssDefaultChans.end(); a++) {
m_msChans[*a].insert(m_pUser->GetUserName());
}
for (map<CString, set<CString> >::iterator it = m_msChans.begin(); it != m_msChans.end(); it++) {
set<CString>& ssNicks = it->second;
@@ -316,6 +329,7 @@ public:
private:
map<CString, set<CString> > m_msChans;
set<CUser*> m_spInjectedPrefixes;
set<CString> m_ssDefaultChans;
};
GLOBALMODULEDEFS(CPartylineMod, "Internal channels and queries for users connected to znc");