mirror of
https://github.com/znc/znc.git
synced 2026-05-08 22:34:45 +02:00
Another patch by DarthGandalf, thanks
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1777 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -29,7 +29,7 @@ public:
|
||||
const CString& GetHostmask() const { return m_sHostmask; }
|
||||
|
||||
bool ChannelMatches(const CString& sChan) const {
|
||||
for (set<CString>::const_iterator it = m_ssChans.begin(); it != m_ssChans.end(); it++) {
|
||||
for (set<CString>::const_iterator it = m_ssChans.begin(); it != m_ssChans.end(); ++it) {
|
||||
if (sChan.AsLower().WildCmp(*it)) {
|
||||
return true;
|
||||
}
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
CString GetChannels() const {
|
||||
CString sRet;
|
||||
|
||||
for (set<CString>::const_iterator it = m_ssChans.begin(); it != m_ssChans.end(); it++) {
|
||||
for (set<CString>::const_iterator it = m_ssChans.begin(); it != m_ssChans.end(); ++it) {
|
||||
if (!sRet.empty()) {
|
||||
sRet += " ";
|
||||
}
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
CString ToString() const {
|
||||
CString sChans;
|
||||
|
||||
for (set<CString>::const_iterator it = m_ssChans.begin(); it != m_ssChans.end(); it++) {
|
||||
for (set<CString>::const_iterator it = m_ssChans.begin(); it != m_ssChans.end(); ++it) {
|
||||
if (!sChans.empty()) {
|
||||
sChans += " ";
|
||||
}
|
||||
@@ -135,7 +135,7 @@ public:
|
||||
}
|
||||
|
||||
virtual ~CAutoVoiceMod() {
|
||||
for (map<CString, CAutoVoiceUser*>::iterator it = m_msUsers.begin(); it != m_msUsers.end(); it++) {
|
||||
for (map<CString, CAutoVoiceUser*>::iterator it = m_msUsers.begin(); it != m_msUsers.end(); ++it) {
|
||||
delete it->second;
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ public:
|
||||
virtual void OnJoin(const CNick& Nick, CChan& Channel) {
|
||||
// If we have ops in this chan
|
||||
if (Channel.HasPerm(CChan::Op) || Channel.HasPerm(CChan::HalfOp)) {
|
||||
for (map<CString, CAutoVoiceUser*>::iterator it = m_msUsers.begin(); it != m_msUsers.end(); it++) {
|
||||
for (map<CString, CAutoVoiceUser*>::iterator it = m_msUsers.begin(); it != m_msUsers.end(); ++it) {
|
||||
// and the nick who joined is a valid user
|
||||
if (it->second->HostMatches(Nick.GetHostMask()) && it->second->ChannelMatches(Channel.GetName())) {
|
||||
PutIRC("MODE " + Channel.GetName() + " +v " + Nick.GetNick());
|
||||
@@ -190,7 +190,7 @@ public:
|
||||
Table.AddColumn("Hostmask");
|
||||
Table.AddColumn("Channels");
|
||||
|
||||
for (map<CString, CAutoVoiceUser*>::iterator it = m_msUsers.begin(); it != m_msUsers.end(); it++) {
|
||||
for (map<CString, CAutoVoiceUser*>::iterator it = m_msUsers.begin(); it != m_msUsers.end(); ++it) {
|
||||
Table.AddRow();
|
||||
Table.SetCell("User", it->second->GetUsername());
|
||||
Table.SetCell("Hostmask", it->second->GetHostmask());
|
||||
@@ -235,7 +235,7 @@ public:
|
||||
}
|
||||
|
||||
CAutoVoiceUser* FindUserByHost(const CString& sHostmask, const CString& sChannel = "") {
|
||||
for (map<CString, CAutoVoiceUser*>::iterator it = m_msUsers.begin(); it != m_msUsers.end(); it++) {
|
||||
for (map<CString, CAutoVoiceUser*>::iterator it = m_msUsers.begin(); it != m_msUsers.end(); ++it) {
|
||||
CAutoVoiceUser* pUser = it->second;
|
||||
|
||||
if (pUser->HostMatches(sHostmask) && (sChannel.empty() || pUser->ChannelMatches(sChannel))) {
|
||||
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
MCString::iterator it2;
|
||||
|
||||
// Load saved settings
|
||||
for (it2 = BeginNV(); it2 != EndNV(); it2++) {
|
||||
for (it2 = BeginNV(); it2 != EndNV(); ++it2) {
|
||||
// Ignore errors
|
||||
Block(it2->first);
|
||||
}
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
// Parse arguments, each argument is a user name to block
|
||||
sArgs.Split(" ", vArgs, false);
|
||||
|
||||
for (it = vArgs.begin(); it != vArgs.end(); it++) {
|
||||
for (it = vArgs.begin(); it != vArgs.end(); ++it) {
|
||||
if (!Block(*it)) {
|
||||
sMessage = "Could not block [" + *it + "]";
|
||||
return false;
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
|
||||
Table.AddColumn("Blocked user");
|
||||
|
||||
for (it = BeginNV(); it != EndNV(); it++) {
|
||||
for (it = BeginNV(); it != EndNV(); ++it) {
|
||||
Table.AddRow();
|
||||
Table.SetCell("Blocked user", it->first);
|
||||
}
|
||||
@@ -99,7 +99,7 @@ public:
|
||||
private:
|
||||
bool IsBlocked(const CString& sUser) {
|
||||
MCString::iterator it;
|
||||
for (it = BeginNV(); it != EndNV(); it++) {
|
||||
for (it = BeginNV(); it != EndNV(); ++it) {
|
||||
if (sUser.Equals(it->first)) {
|
||||
return true;
|
||||
}
|
||||
@@ -116,7 +116,7 @@ private:
|
||||
// Disconnect all clients
|
||||
vector<CClient*>& vpClients = pUser->GetClients();
|
||||
vector<CClient*>::iterator it;
|
||||
for (it = vpClients.begin(); it != vpClients.end(); it++) {
|
||||
for (it = vpClients.begin(); it != vpClients.end(); ++it) {
|
||||
(*it)->PutStatusNotice(MESSAGE);
|
||||
(*it)->Close(Csock::CLT_AFTERWRITE);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ public:
|
||||
{
|
||||
const vector<CChan*>& vChans = m_pUser->GetChans();
|
||||
|
||||
for(vector<CChan*>::const_iterator it = vChans.begin(); it != vChans.end(); it++)
|
||||
for(vector<CChan*>::const_iterator it = vChans.begin(); it != vChans.end(); ++it)
|
||||
{
|
||||
PutUser(":ZNC!znc@znc.in KICK " + (*it)->GetName() + " " + m_pUser->GetIRCNick().GetNick()
|
||||
+ " :You have been disconnected from the IRC server");
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
sLine.Token(1, true).TrimLeft_n(":").Split(" ", vsNicks, false);
|
||||
|
||||
CString sBNCNicks = "";
|
||||
for (it = vsNicks.begin(); it != vsNicks.end(); it++) {
|
||||
for (it = vsNicks.begin(); it != vsNicks.end(); ++it) {
|
||||
if (IsOnlineModNick(*it)) {
|
||||
sBNCNicks += " " + *it;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
Limits::iterator it;
|
||||
time_t now = time(NULL);
|
||||
|
||||
for (it = m_chans.begin(); it != m_chans.end(); it++) {
|
||||
for (it = m_chans.begin(); it != m_chans.end(); ++it) {
|
||||
// The timeout for this channel did not expire yet?
|
||||
if (it->second.first + (time_t)m_iThresholdSecs >= now)
|
||||
continue;
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
Table.AddColumn("User");
|
||||
Table.AddColumn("Last Seen");
|
||||
|
||||
for (it = mUsers.begin(); it != mUsers.end(); it++) {
|
||||
for (it = mUsers.begin(); it != mUsers.end(); ++it) {
|
||||
CUser *pUser = it->second;
|
||||
time_t last = GetTime(pUser);
|
||||
|
||||
|
||||
@@ -308,7 +308,7 @@ private:
|
||||
}
|
||||
|
||||
const map<CString,CNick*>& msNicks = pChannel->GetNicks();
|
||||
for (map<CString,CNick*>::const_iterator it = msNicks.begin(); it != msNicks.end(); it++) {
|
||||
for (map<CString,CNick*>::const_iterator it = msNicks.begin(); it != msNicks.end(); ++it) {
|
||||
const CNick& Nick = *it->second;
|
||||
l[0] = (Nick.GetNick()).c_str();
|
||||
l[1] = (Nick.GetIdent()).c_str();
|
||||
|
||||
+15
-15
@@ -62,7 +62,7 @@ public:
|
||||
virtual bool OnLoad(const CString& sArgs, CString& sMessage) {
|
||||
const map<CString, CUser*>& msUsers = CZNC::Get().GetUserMap();
|
||||
|
||||
for (map<CString, CUser*>::const_iterator it = msUsers.begin(); it != msUsers.end(); it++) {
|
||||
for (map<CString, CUser*>::const_iterator it = msUsers.begin(); it != msUsers.end(); ++it) {
|
||||
CUser* pUser = it->second;
|
||||
if (pUser->GetIRCSock()) {
|
||||
if (pUser->GetChanPrefixes().find(CHAN_PREFIX_1) == CString::npos) {
|
||||
@@ -87,7 +87,7 @@ public:
|
||||
|
||||
void Load() {
|
||||
VCString vsChannels;
|
||||
for (MCString::iterator it = BeginNV(); it != EndNV(); it++) {
|
||||
for (MCString::iterator it = BeginNV(); it != EndNV(); ++it) {
|
||||
CUser* pUser = CZNC::Get().FindUser(it->first);
|
||||
CPartylineChannel* pChannel;
|
||||
it->second.Split(",", vsChannels, false);
|
||||
@@ -97,7 +97,7 @@ public:
|
||||
continue;
|
||||
}
|
||||
|
||||
for (VCString::iterator i = vsChannels.begin(); i != vsChannels.end(); i++) {
|
||||
for (VCString::iterator i = vsChannels.begin(); i != vsChannels.end(); ++i) {
|
||||
if (i->Trim_n().empty())
|
||||
continue;
|
||||
pChannel = GetChannel(*i);
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
const CString &sUser = pUser->GetUserName();
|
||||
|
||||
for (set<CPartylineChannel*>::iterator it = m_ssChannels.begin();
|
||||
it != m_ssChannels.end(); it++) {
|
||||
it != m_ssChannels.end(); ++it) {
|
||||
if ((*it)->IsFixedChan(sUser)) {
|
||||
sChans += "," + (*it)->GetName();
|
||||
}
|
||||
@@ -128,7 +128,7 @@ public:
|
||||
|
||||
virtual EModRet OnDeleteUser(CUser& User) {
|
||||
// Loop through each chan
|
||||
for (set<CPartylineChannel*>::iterator it = m_ssChannels.begin(); it != m_ssChannels.end(); it++) {
|
||||
for (set<CPartylineChannel*>::iterator it = m_ssChannels.begin(); it != m_ssChannels.end(); ++it) {
|
||||
RemoveUser(&User, *it, "KICK", true, "User deleted", true);
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ public:
|
||||
}
|
||||
|
||||
// Make sure this user is in the default channels
|
||||
for (set<CString>::iterator a = m_ssDefaultChans.begin(); a != m_ssDefaultChans.end(); a++) {
|
||||
for (set<CString>::iterator a = m_ssDefaultChans.begin(); a != m_ssDefaultChans.end(); ++a) {
|
||||
CPartylineChannel* pChannel = GetChannel(*a);
|
||||
const CString& sNick = m_pUser->GetUserName();
|
||||
|
||||
@@ -181,7 +181,7 @@ public:
|
||||
|
||||
CString sNickMask = m_pClient->GetNickMask();
|
||||
|
||||
for (set<CPartylineChannel*>::iterator it = m_ssChannels.begin(); it != m_ssChannels.end(); it++) {
|
||||
for (set<CPartylineChannel*>::iterator it = m_ssChannels.begin(); it != m_ssChannels.end(); ++it) {
|
||||
const set<CString>& ssNicks = (*it)->GetNicks();
|
||||
|
||||
if ((*it)->IsInChannel(m_pUser->GetUserName())) {
|
||||
@@ -200,7 +200,7 @@ public:
|
||||
|
||||
virtual void OnClientDisconnect() {
|
||||
if (!m_pUser->IsUserAttached() && !m_pUser->IsBeingDeleted()) {
|
||||
for (set<CPartylineChannel*>::iterator it = m_ssChannels.begin(); it != m_ssChannels.end(); it++) {
|
||||
for (set<CPartylineChannel*>::iterator it = m_ssChannels.begin(); it != m_ssChannels.end(); ++it) {
|
||||
const set<CString>& ssNicks = (*it)->GetNicks();
|
||||
|
||||
if (ssNicks.find(m_pUser->GetUserName()) != ssNicks.end()) {
|
||||
@@ -474,7 +474,7 @@ public:
|
||||
Table.AddColumn("Channel");
|
||||
Table.AddColumn("Users");
|
||||
|
||||
for (set<CPartylineChannel*>::const_iterator a = m_ssChannels.begin(); a != m_ssChannels.end(); a++) {
|
||||
for (set<CPartylineChannel*>::const_iterator a = m_ssChannels.begin(); a != m_ssChannels.end(); ++a) {
|
||||
Table.AddRow();
|
||||
|
||||
Table.SetCell("Channel", (*a)->GetName());
|
||||
@@ -546,7 +546,7 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
for (set<CPartylineChannel*>::const_iterator a = m_ssChannels.begin(); a != m_ssChannels.end(); a++) {
|
||||
for (set<CPartylineChannel*>::const_iterator a = m_ssChannels.begin(); a != m_ssChannels.end(); ++a) {
|
||||
if ((*a)->IsFixedChan(sUser)) {
|
||||
PutModule((*a)->GetName());
|
||||
}
|
||||
@@ -565,7 +565,7 @@ public:
|
||||
return;
|
||||
}
|
||||
const set<CString>& sNicks = pChan->GetNicks();
|
||||
for (set<CString>::const_iterator it = sNicks.begin(); it != sNicks.end(); it++) {
|
||||
for (set<CString>::const_iterator it = sNicks.begin(); it != sNicks.end(); ++it) {
|
||||
if (pChan->IsFixedChan(*it)) {
|
||||
PutModule(*it);
|
||||
}
|
||||
@@ -603,7 +603,7 @@ public:
|
||||
if (!pClient)
|
||||
pClient = m_pClient;
|
||||
|
||||
for (map<CString, CUser*>::const_iterator it = msUsers.begin(); it != msUsers.end(); it++) {
|
||||
for (map<CString, CUser*>::const_iterator it = msUsers.begin(); it != msUsers.end(); ++it) {
|
||||
if (ssNicks.find(it->first) != ssNicks.end()) {
|
||||
if (it->second == pUser) {
|
||||
if (bIncludeCurUser) {
|
||||
@@ -625,7 +625,7 @@ public:
|
||||
|
||||
const vector<CClient*>& vClients = pUser->GetClients();
|
||||
vector<CClient*>::const_iterator it;
|
||||
for (it = vClients.begin(); it != vClients.end(); it++) {
|
||||
for (it = vClients.begin(); it != vClients.end(); ++it) {
|
||||
(*it)->PutClient(sPre + (*it)->GetNick() + sPost);
|
||||
}
|
||||
}
|
||||
@@ -633,7 +633,7 @@ public:
|
||||
void SendNickList(CUser* pUser, const set<CString>& ssNicks, const CString& sChan) {
|
||||
CString sNickList;
|
||||
|
||||
for (set<CString>::const_iterator it = ssNicks.begin(); it != ssNicks.end(); it++) {
|
||||
for (set<CString>::const_iterator it = ssNicks.begin(); it != ssNicks.end(); ++it) {
|
||||
CUser* pChanUser = CZNC::Get().FindUser(*it);
|
||||
|
||||
if (pChanUser && pChanUser->IsUserAttached()) {
|
||||
@@ -658,7 +658,7 @@ public:
|
||||
CPartylineChannel* FindChannel(const CString& sChan) {
|
||||
CString sChannel = sChan.AsLower();
|
||||
|
||||
for (set<CPartylineChannel*>::iterator it = m_ssChannels.begin(); it != m_ssChannels.end(); it++) {
|
||||
for (set<CPartylineChannel*>::iterator it = m_ssChannels.begin(); it != m_ssChannels.end(); ++it) {
|
||||
if ((*it)->GetName().AsLower() == sChannel)
|
||||
return *it;
|
||||
}
|
||||
|
||||
+2
-2
@@ -89,7 +89,7 @@ public:
|
||||
|
||||
virtual void OnIRCConnected() {
|
||||
for (VCString::iterator it = m_vPerform.begin();
|
||||
it != m_vPerform.end(); it++) {
|
||||
it != m_vPerform.end(); ++it) {
|
||||
PutIRC(GetUser()->ExpandString(*it));
|
||||
}
|
||||
}
|
||||
@@ -98,7 +98,7 @@ private:
|
||||
bool Save() {
|
||||
CString sBuffer = "";
|
||||
|
||||
for (VCString::iterator it = m_vPerform.begin(); it != m_vPerform.end(); it++) {
|
||||
for (VCString::iterator it = m_vPerform.begin(); it != m_vPerform.end(); ++it) {
|
||||
sBuffer += *it + "\n";
|
||||
}
|
||||
SetNV("Perform", sBuffer);
|
||||
|
||||
@@ -110,7 +110,7 @@ public:
|
||||
|
||||
sFile.Split("\n", vsLines);
|
||||
|
||||
for (it = vsLines.begin(); it != vsLines.end(); it++) {
|
||||
for (it = vsLines.begin(); it != vsLines.end(); ++it) {
|
||||
CString sLine(*it);
|
||||
sLine.Trim();
|
||||
pChan->AddBuffer(sLine);
|
||||
@@ -187,7 +187,7 @@ public:
|
||||
|
||||
sFile.Split("\n", vsLines);
|
||||
|
||||
for (it = vsLines.begin(); it != vsLines.end(); it++) {
|
||||
for (it = vsLines.begin(); it != vsLines.end(); ++it) {
|
||||
CString sLine(*it);
|
||||
sLine.Trim();
|
||||
PutModule("[" + sLine + "]");
|
||||
@@ -218,7 +218,7 @@ public:
|
||||
|
||||
sFile.Split("\n", vsLines);
|
||||
|
||||
for (it = vsLines.begin(); it != vsLines.end(); it++) {
|
||||
for (it = vsLines.begin(); it != vsLines.end(); ++it) {
|
||||
CString sLine(*it);
|
||||
sLine.Trim();
|
||||
PutUser(sLine);
|
||||
|
||||
+5
-5
@@ -122,7 +122,7 @@ public:
|
||||
virtual void OnClientLogin()
|
||||
{
|
||||
set<CSocket*>::const_iterator it;
|
||||
for (it = BeginSockets(); it != EndSockets(); it++) {
|
||||
for (it = BeginSockets(); it != EndSockets(); ++it) {
|
||||
CSChatSock *p = (CSChatSock*) *it;
|
||||
|
||||
if (p->GetType() == CSChatSock::LISTENER)
|
||||
@@ -155,7 +155,7 @@ public:
|
||||
if (sCom.Equals("chat") && !sArgs.empty()) {
|
||||
CString sNick = "(s)" + sArgs;
|
||||
set<CSocket*>::const_iterator it;
|
||||
for (it = BeginSockets(); it != EndSockets(); it++) {
|
||||
for (it = BeginSockets(); it != EndSockets(); ++it) {
|
||||
CSChatSock *pSock = (CSChatSock*) *it;
|
||||
|
||||
if (pSock->GetChatNick().Equals(sNick)) {
|
||||
@@ -194,7 +194,7 @@ public:
|
||||
Table.AddColumn("Cipher");
|
||||
|
||||
set<CSocket*>::const_iterator it;
|
||||
for (it = BeginSockets(); it != EndSockets(); it++) {
|
||||
for (it = BeginSockets(); it != EndSockets(); ++it) {
|
||||
Table.AddRow();
|
||||
|
||||
CSChatSock *pSock = (CSChatSock*) *it;
|
||||
@@ -231,7 +231,7 @@ public:
|
||||
sArgs = "(s)" + sArgs;
|
||||
|
||||
set<CSocket*>::const_iterator it;
|
||||
for (it = BeginSockets(); it != EndSockets(); it++) {
|
||||
for (it = BeginSockets(); it != EndSockets(); ++it) {
|
||||
CSChatSock *pSock = (CSChatSock*) *it;
|
||||
|
||||
if (sArgs.Equals(pSock->GetChatNick())) {
|
||||
@@ -250,7 +250,7 @@ public:
|
||||
Table.AddColumn("Cipher");
|
||||
|
||||
set<CSocket*>::const_iterator it;
|
||||
for (it = BeginSockets(); it != EndSockets(); it++) {
|
||||
for (it = BeginSockets(); it != EndSockets(); ++it) {
|
||||
Table.AddRow();
|
||||
Csock *pSock = *it;
|
||||
Table.SetCell("SockName", pSock->GetSockName());
|
||||
|
||||
@@ -21,7 +21,7 @@ public:
|
||||
|
||||
virtual EModRet OnUserPart(CString& sChannel, CString& sMessage)
|
||||
{
|
||||
for (MCString::iterator it = BeginNV(); it != EndNV(); it++)
|
||||
for (MCString::iterator it = BeginNV(); it != EndNV(); ++it)
|
||||
{
|
||||
if (sChannel.Equals(it->first))
|
||||
{
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
else if ((sCmdName == "list") && (sChannel.empty()))
|
||||
{
|
||||
int i = 1;
|
||||
for (MCString::iterator it = BeginNV(); it != EndNV(); it++, i++)
|
||||
for (MCString::iterator it = BeginNV(); it != EndNV(); ++it, i++)
|
||||
{
|
||||
if (it->second.empty())
|
||||
PutModule(CString(i) + ": " + it->first);
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
if (!m_pUser->GetIRCSock())
|
||||
return;
|
||||
|
||||
for (MCString::iterator it = BeginNV(); it != EndNV(); it++)
|
||||
for (MCString::iterator it = BeginNV(); it != EndNV(); ++it)
|
||||
{
|
||||
CChan *pChan = m_pUser->FindChan(it->first);
|
||||
if (!pChan) {
|
||||
@@ -116,7 +116,7 @@ bool CStickyChan::OnLoad(const CString& sArgs, CString& sMessage)
|
||||
VCString::iterator it;
|
||||
sArgs.Split(",", vsChans, false);
|
||||
|
||||
for (it = vsChans.begin(); it != vsChans.end(); it++) {
|
||||
for (it = vsChans.begin(); it != vsChans.end(); ++it) {
|
||||
CString sChan = it->Token(0);
|
||||
CString sKey = it->Token(1, true);
|
||||
SetNV(sChan, sKey);
|
||||
|
||||
+5
-5
@@ -289,7 +289,7 @@ public:
|
||||
|
||||
private:
|
||||
void Process(const CNick& Nick, const CString& sMessage, const CString& sSource) {
|
||||
for (list<CWatchEntry>::iterator it = m_lsWatchers.begin(); it != m_lsWatchers.end(); it++) {
|
||||
for (list<CWatchEntry>::iterator it = m_lsWatchers.begin(); it != m_lsWatchers.end(); ++it) {
|
||||
CWatchEntry& WatchEntry = *it;
|
||||
|
||||
if (WatchEntry.IsMatch(Nick, sMessage, sSource, m_pUser)) {
|
||||
@@ -306,7 +306,7 @@ private:
|
||||
|
||||
void SetDisabled(unsigned int uIdx, bool bDisabled) {
|
||||
if (uIdx == (unsigned int) ~0) {
|
||||
for (list<CWatchEntry>::iterator it = m_lsWatchers.begin(); it != m_lsWatchers.end(); it++) {
|
||||
for (list<CWatchEntry>::iterator it = m_lsWatchers.begin(); it != m_lsWatchers.end(); ++it) {
|
||||
(*it).SetDisabled(bDisabled);
|
||||
}
|
||||
|
||||
@@ -478,7 +478,7 @@ private:
|
||||
CWatchEntry WatchEntry(sHostMask, sTarget, sPattern);
|
||||
|
||||
bool bExists = false;
|
||||
for (list<CWatchEntry>::iterator it = m_lsWatchers.begin(); it != m_lsWatchers.end(); it++) {
|
||||
for (list<CWatchEntry>::iterator it = m_lsWatchers.begin(); it != m_lsWatchers.end(); ++it) {
|
||||
if (*it == WatchEntry) {
|
||||
sMessage = "Entry for [" + WatchEntry.GetHostMask() + "] already exists.";
|
||||
bExists = true;
|
||||
@@ -505,7 +505,7 @@ private:
|
||||
|
||||
void Save() {
|
||||
ClearNV(false);
|
||||
for (list<CWatchEntry>::iterator it = m_lsWatchers.begin(); it != m_lsWatchers.end(); it++) {
|
||||
for (list<CWatchEntry>::iterator it = m_lsWatchers.begin(); it != m_lsWatchers.end(); ++it) {
|
||||
CWatchEntry& WatchEntry = *it;
|
||||
CString sSave;
|
||||
|
||||
@@ -530,7 +530,7 @@ private:
|
||||
|
||||
bool bWarn = false;
|
||||
|
||||
for (MCString::iterator it = BeginNV(); it != EndNV(); it++) {
|
||||
for (MCString::iterator it = BeginNV(); it != EndNV(); ++it) {
|
||||
VCString vList;
|
||||
it->first.Split("\n", vList);
|
||||
|
||||
|
||||
@@ -586,7 +586,7 @@ bool CWebAdminSock::SettingsPage(CString& sPageRet) {
|
||||
set<CModInfo> ssGlobalMods;
|
||||
CZNC::Get().GetModules().GetAvailableMods(ssGlobalMods, true);
|
||||
|
||||
for (set<CModInfo>::iterator it = ssGlobalMods.begin(); it != ssGlobalMods.end(); it++) {
|
||||
for (set<CModInfo>::iterator it = ssGlobalMods.begin(); it != ssGlobalMods.end(); ++it) {
|
||||
const CModInfo& Info = *it;
|
||||
CTemplate& l = m_Template.AddRow("ModuleLoop");
|
||||
|
||||
@@ -634,7 +634,7 @@ bool CWebAdminSock::SettingsPage(CString& sPageRet) {
|
||||
set<CString> ssArgs;
|
||||
GetParamValues("loadmod", ssArgs);
|
||||
|
||||
for (set<CString>::iterator it = ssArgs.begin(); it != ssArgs.end(); it++) {
|
||||
for (set<CString>::iterator it = ssArgs.begin(); it != ssArgs.end(); ++it) {
|
||||
CString sModRet;
|
||||
CString sModName = (*it).TrimRight_n("\r");
|
||||
|
||||
@@ -667,7 +667,7 @@ bool CWebAdminSock::SettingsPage(CString& sPageRet) {
|
||||
}
|
||||
}
|
||||
|
||||
for (set<CString>::iterator it2 = ssUnloadMods.begin(); it2 != ssUnloadMods.end(); it2++) {
|
||||
for (set<CString>::iterator it2 = ssUnloadMods.begin(); it2 != ssUnloadMods.end(); ++it2) {
|
||||
CZNC::Get().GetModules().UnloadModule(*it2);
|
||||
}
|
||||
|
||||
@@ -813,7 +813,7 @@ bool CWebAdminSock::UserPage(CString& sPageRet, CUser* pUser) {
|
||||
m_Template["MaxJoins"] = CString(pUser->MaxJoins());
|
||||
|
||||
const set<CString>& ssAllowedHosts = pUser->GetAllowedHosts();
|
||||
for (set<CString>::const_iterator it = ssAllowedHosts.begin(); it != ssAllowedHosts.end(); it++) {
|
||||
for (set<CString>::const_iterator it = ssAllowedHosts.begin(); it != ssAllowedHosts.end(); ++it) {
|
||||
CTemplate& l = m_Template.AddRow("AllowedHostLoop");
|
||||
l["Host"] = *it;
|
||||
}
|
||||
@@ -825,7 +825,7 @@ bool CWebAdminSock::UserPage(CString& sPageRet, CUser* pUser) {
|
||||
}
|
||||
|
||||
const MCString& msCTCPReplies = pUser->GetCTCPReplies();
|
||||
for (MCString::const_iterator it2 = msCTCPReplies.begin(); it2 != msCTCPReplies.end(); it2++) {
|
||||
for (MCString::const_iterator it2 = msCTCPReplies.begin(); it2 != msCTCPReplies.end(); ++it2) {
|
||||
CTemplate& l = m_Template.AddRow("CTCPLoop");
|
||||
l["CTCP"] = it2->first + " " + it2->second;
|
||||
}
|
||||
@@ -881,7 +881,7 @@ bool CWebAdminSock::UserPage(CString& sPageRet, CUser* pUser) {
|
||||
set<CModInfo> ssUserMods;
|
||||
CZNC::Get().GetModules().GetAvailableMods(ssUserMods);
|
||||
|
||||
for (set<CModInfo>::iterator it = ssUserMods.begin(); it != ssUserMods.end(); it++) {
|
||||
for (set<CModInfo>::iterator it = ssUserMods.begin(); it != ssUserMods.end(); ++it) {
|
||||
const CModInfo& Info = *it;
|
||||
CTemplate& l = m_Template.AddRow("ModuleLoop");
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ CZNC::~CZNC() {
|
||||
#ifdef _MODULES
|
||||
m_pModules->UnloadAll();
|
||||
|
||||
for (map<CString,CUser*>::iterator a = m_msUsers.begin(); a != m_msUsers.end(); a++) {
|
||||
for (map<CString,CUser*>::iterator a = m_msUsers.begin(); a != m_msUsers.end(); ++a) {
|
||||
a->second->GetModules().UnloadAll();
|
||||
}
|
||||
#endif
|
||||
@@ -62,7 +62,7 @@ CZNC::~CZNC() {
|
||||
delete m_vpListeners[b];
|
||||
}
|
||||
|
||||
for (map<CString,CUser*>::iterator a = m_msUsers.begin(); a != m_msUsers.end(); a++) {
|
||||
for (map<CString,CUser*>::iterator a = m_msUsers.begin(); a != m_msUsers.end(); ++a) {
|
||||
a->second->SetBeingDeleted(true);
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ bool CZNC::OnBoot() {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (map<CString,CUser*>::iterator it = m_msUsers.begin(); it != m_msUsers.end(); it++) {
|
||||
for (map<CString,CUser*>::iterator it = m_msUsers.begin(); it != m_msUsers.end(); ++it) {
|
||||
if (!it->second->GetModules().OnBoot()) {
|
||||
return false;
|
||||
}
|
||||
@@ -196,7 +196,7 @@ bool CZNC::HandleUserDeletion()
|
||||
return false;
|
||||
|
||||
end = m_msDelUsers.end();
|
||||
for (it = m_msDelUsers.begin(); it != end; it++) {
|
||||
for (it = m_msDelUsers.begin(); it != end; ++it) {
|
||||
CUser* pUser = it->second;
|
||||
pUser->SetBeingDeleted(true);
|
||||
|
||||
@@ -404,7 +404,7 @@ bool CZNC::WritePemFile() {
|
||||
}
|
||||
|
||||
void CZNC::DeleteUsers() {
|
||||
for (map<CString,CUser*>::iterator a = m_msUsers.begin(); a != m_msUsers.end(); a++) {
|
||||
for (map<CString,CUser*>::iterator a = m_msUsers.begin(); a != m_msUsers.end(); ++a) {
|
||||
a->second->SetBeingDeleted(true);
|
||||
delete a->second;
|
||||
}
|
||||
@@ -424,7 +424,7 @@ Csock* CZNC::FindSockByName(const CString& sSockName) {
|
||||
}
|
||||
|
||||
bool CZNC::IsHostAllowed(const CString& sHostMask) const {
|
||||
for (map<CString,CUser*>::const_iterator a = m_msUsers.begin(); a != m_msUsers.end(); a++) {
|
||||
for (map<CString,CUser*>::const_iterator a = m_msUsers.begin(); a != m_msUsers.end(); ++a) {
|
||||
if (a->second->IsHostAllowed(sHostMask)) {
|
||||
return true;
|
||||
}
|
||||
@@ -602,7 +602,7 @@ bool CZNC::WriteConfig() {
|
||||
}
|
||||
#endif
|
||||
|
||||
for (map<CString,CUser*>::iterator it = m_msUsers.begin(); it != m_msUsers.end(); it++) {
|
||||
for (map<CString,CUser*>::iterator it = m_msUsers.begin(); it != m_msUsers.end(); ++it) {
|
||||
CString sErr;
|
||||
|
||||
if (!it->second->IsValid(sErr)) {
|
||||
@@ -694,7 +694,7 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) {
|
||||
Table.AddColumn("Description");
|
||||
set<CModInfo>::iterator it;
|
||||
|
||||
for (it = ssGlobalMods.begin(); it != ssGlobalMods.end(); it++) {
|
||||
for (it = ssGlobalMods.begin(); it != ssGlobalMods.end(); ++it) {
|
||||
const CModInfo& Info = *it;
|
||||
Table.AddRow();
|
||||
Table.SetCell("Name", Info.GetName());
|
||||
@@ -712,7 +712,7 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) {
|
||||
|
||||
CUtils::PrintMessage("");
|
||||
|
||||
for (it = ssGlobalMods.begin(); it != ssGlobalMods.end(); it++) {
|
||||
for (it = ssGlobalMods.begin(); it != ssGlobalMods.end(); ++it) {
|
||||
const CModInfo& Info = *it;
|
||||
CString sName = Info.GetName();
|
||||
|
||||
@@ -803,7 +803,7 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) {
|
||||
Table.AddColumn("Description");
|
||||
set<CModInfo>::iterator it;
|
||||
|
||||
for (it = ssUserMods.begin(); it != ssUserMods.end(); it++) {
|
||||
for (it = ssUserMods.begin(); it != ssUserMods.end(); ++it) {
|
||||
const CModInfo& Info = *it;
|
||||
Table.AddRow();
|
||||
Table.SetCell("Name", Info.GetName());
|
||||
@@ -821,7 +821,7 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) {
|
||||
|
||||
CUtils::PrintMessage("");
|
||||
|
||||
for (it = ssUserMods.begin(); it != ssUserMods.end(); it++) {
|
||||
for (it = ssUserMods.begin(); it != ssUserMods.end(); ++it) {
|
||||
const CModInfo& Info = *it;
|
||||
CString sName = Info.GetName();
|
||||
|
||||
@@ -994,7 +994,7 @@ bool CZNC::RehashConfig(CString& sError)
|
||||
#ifdef _MODULES
|
||||
GetModules().OnPreRehash();
|
||||
for (map<CString, CUser*>::iterator itb = m_msUsers.begin();
|
||||
itb != m_msUsers.end(); itb++) {
|
||||
itb != m_msUsers.end(); ++itb) {
|
||||
itb->second->GetModules().OnPreRehash();
|
||||
}
|
||||
#endif
|
||||
@@ -1010,7 +1010,7 @@ bool CZNC::RehashConfig(CString& sError)
|
||||
#ifdef _MODULES
|
||||
GetModules().OnPostRehash();
|
||||
for (map<CString, CUser*>::iterator it = m_msUsers.begin();
|
||||
it != m_msUsers.end(); it++) {
|
||||
it != m_msUsers.end(); ++it) {
|
||||
it->second->GetModules().OnPostRehash();
|
||||
}
|
||||
#endif
|
||||
@@ -1606,7 +1606,7 @@ bool CZNC::DoRehash(CString& sError)
|
||||
|
||||
#ifdef _MODULES
|
||||
// First step: Load and reload new modules or modules with new arguments
|
||||
for (MCString::iterator it = msModules.begin(); it != msModules.end(); it++) {
|
||||
for (MCString::iterator it = msModules.begin(); it != msModules.end(); ++it) {
|
||||
CString sModName = it->first;
|
||||
CString sArgs = it->second;
|
||||
CString sModRet;
|
||||
@@ -1656,7 +1656,7 @@ bool CZNC::DoRehash(CString& sError)
|
||||
ssUnload.insert(pCurMod->GetModName());
|
||||
}
|
||||
|
||||
for (set<CString>::iterator it = ssUnload.begin(); it != ssUnload.end(); it++) {
|
||||
for (set<CString>::iterator it = ssUnload.begin(); it != ssUnload.end(); ++it) {
|
||||
if (GetModules().UnloadModule(*it))
|
||||
CUtils::PrintMessage("Unloaded Global Module [" + *it + "]");
|
||||
else
|
||||
@@ -1664,7 +1664,7 @@ bool CZNC::DoRehash(CString& sError)
|
||||
}
|
||||
|
||||
// last step, throw unhandled config items at global config
|
||||
for (std::list<CGlobalModuleConfigLine>::iterator it = lGlobalModuleConfigLine.begin(); it != lGlobalModuleConfigLine.end(); it++)
|
||||
for (std::list<CGlobalModuleConfigLine>::iterator it = lGlobalModuleConfigLine.begin(); it != lGlobalModuleConfigLine.end(); ++it)
|
||||
{
|
||||
if ((pChan && pChan == it->m_pChan) || (pUser && pUser == it->m_pUser))
|
||||
continue; // skip unclosed user or chan
|
||||
@@ -1726,7 +1726,7 @@ bool CZNC::AddVHost(const CString& sHost) {
|
||||
|
||||
bool CZNC::RemVHost(const CString& sHost) {
|
||||
VCString::iterator it;
|
||||
for (it = m_vsVHosts.begin(); it != m_vsVHosts.end(); it++) {
|
||||
for (it = m_vsVHosts.begin(); it != m_vsVHosts.end(); ++it) {
|
||||
if (sHost.Equals(*it)) {
|
||||
m_vsVHosts.erase(it);
|
||||
return true;
|
||||
@@ -1738,7 +1738,7 @@ bool CZNC::RemVHost(const CString& sHost) {
|
||||
|
||||
void CZNC::Broadcast(const CString& sMessage, bool bAdminOnly,
|
||||
CUser* pSkipUser, CClient *pSkipClient) {
|
||||
for (map<CString,CUser*>::iterator a = m_msUsers.begin(); a != m_msUsers.end(); a++) {
|
||||
for (map<CString,CUser*>::iterator a = m_msUsers.begin(); a != m_msUsers.end(); ++a) {
|
||||
if (bAdminOnly && !a->second->IsAdmin())
|
||||
continue;
|
||||
|
||||
@@ -1802,13 +1802,13 @@ CZNC::TrafficStatsMap CZNC::GetTrafficStats(TrafficStatsPair &Users,
|
||||
uiZNC_in = BytesRead();
|
||||
uiZNC_out = BytesWritten();
|
||||
|
||||
for (map<CString, CUser*>::const_iterator it = msUsers.begin(); it != msUsers.end(); it++) {
|
||||
for (map<CString, CUser*>::const_iterator it = msUsers.begin(); it != msUsers.end(); ++it) {
|
||||
ret[it->first] = TrafficStatsPair(it->second->BytesRead(), it->second->BytesWritten());
|
||||
uiUsers_in += it->second->BytesRead();
|
||||
uiUsers_out += it->second->BytesWritten();
|
||||
}
|
||||
|
||||
for (CSockManager::const_iterator it = m_Manager.begin(); it != m_Manager.end(); it++) {
|
||||
for (CSockManager::const_iterator it = m_Manager.begin(); it != m_Manager.end(); ++it) {
|
||||
if ((*it)->GetSockName().Left(5) == "IRC::") {
|
||||
CIRCSock *p = (CIRCSock *) *it;
|
||||
ret[p->GetUser()->GetUserName()].first += p->GetBytesRead();
|
||||
|
||||
Reference in New Issue
Block a user