summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-03-14 12:56:20 +0100
committerAttila Molnar <attilamolnar@hush.com>2014-03-14 12:56:20 +0100
commit146d85b5dea9ecb803a9a47c68b5489905634125 (patch)
treec8156a5db6cb0afaf5310a59d8c1a7c4ab6de838 /src/modules
parentdd94ac5e3c6485c294394cc18cbc4228510e7a47 (diff)
Add InspIRCd::GetChans(), remove ChannelCount()
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_channames.cpp3
-rw-r--r--src/modules/m_httpd_stats.cpp7
-rw-r--r--src/modules/m_permchannels.cpp3
-rw-r--r--src/modules/m_spanningtree/netburst.cpp3
4 files changed, 10 insertions, 6 deletions
diff --git a/src/modules/m_channames.cpp b/src/modules/m_channames.cpp
index a9ef6729e..69b501792 100644
--- a/src/modules/m_channames.cpp
+++ b/src/modules/m_channames.cpp
@@ -66,7 +66,8 @@ class ModuleChannelNames : public Module
{
badchan = true;
std::vector<Channel*> chanvec;
- for (chan_hash::const_iterator i = ServerInstance->chanlist->begin(); i != ServerInstance->chanlist->end(); ++i)
+ const chan_hash& chans = ServerInstance->GetChans();
+ for (chan_hash::const_iterator i = chans.begin(); i != chans.end(); ++i)
{
if (!ServerInstance->IsChannel(i->second->name))
chanvec.push_back(i->second);
diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp
index 8a90074a9..75be402be 100644
--- a/src/modules/m_httpd_stats.cpp
+++ b/src/modules/m_httpd_stats.cpp
@@ -105,7 +105,7 @@ class ModuleHttpStats : public Module
data << "<general>";
data << "<usercount>" << ServerInstance->Users->clientlist->size() << "</usercount>";
- data << "<channelcount>" << ServerInstance->chanlist->size() << "</channelcount>";
+ data << "<channelcount>" << ServerInstance->GetChans().size() << "</channelcount>";
data << "<opercount>" << ServerInstance->Users->all_opers.size() << "</opercount>";
data << "<socketcount>" << (SocketEngine::GetUsedFds()) << "</socketcount><socketmax>" << SocketEngine::GetMaxFds() << "</socketmax><socketengine>" INSPIRCD_SOCKETENGINE_NAME "</socketengine>";
@@ -150,9 +150,10 @@ class ModuleHttpStats : public Module
}
data << "</modulelist><channellist>";
- for (chan_hash::const_iterator a = ServerInstance->chanlist->begin(); a != ServerInstance->chanlist->end(); ++a)
+ const chan_hash& chans = ServerInstance->GetChans();
+ for (chan_hash::const_iterator i = chans.begin(); i != chans.end(); ++i)
{
- Channel* c = a->second;
+ Channel* c = i->second;
data << "<channel>";
data << "<usercount>" << c->GetUsers()->size() << "</usercount><channelname>" << Sanitize(c->name) << "</channelname>";
diff --git a/src/modules/m_permchannels.cpp b/src/modules/m_permchannels.cpp
index a4fc6bd09..d23af04bc 100644
--- a/src/modules/m_permchannels.cpp
+++ b/src/modules/m_permchannels.cpp
@@ -74,7 +74,8 @@ static bool WriteDatabase(PermChannel& permchanmode, Module* mod, bool save_list
stream << "# This file is automatically generated by m_permchannels. Any changes will be overwritten." << std::endl
<< "<config format=\"xml\">" << std::endl;
- for (chan_hash::const_iterator i = ServerInstance->chanlist->begin(); i != ServerInstance->chanlist->end(); i++)
+ const chan_hash& chans = ServerInstance->GetChans();
+ for (chan_hash::const_iterator i = chans.begin(); i != chans.end(); ++i)
{
Channel* chan = i->second;
if (!chan->IsModeSet(permchanmode))
diff --git a/src/modules/m_spanningtree/netburst.cpp b/src/modules/m_spanningtree/netburst.cpp
index aa25fcf68..93b4d72f4 100644
--- a/src/modules/m_spanningtree/netburst.cpp
+++ b/src/modules/m_spanningtree/netburst.cpp
@@ -118,7 +118,8 @@ void TreeSocket::DoBurst(TreeServer* s)
/* Send users and their oper status */
this->SendUsers(bs);
- for (chan_hash::const_iterator i = ServerInstance->chanlist->begin(); i != ServerInstance->chanlist->end(); ++i)
+ const chan_hash& chans = ServerInstance->GetChans();
+ for (chan_hash::const_iterator i = chans.begin(); i != chans.end(); ++i)
SyncChannel(i->second, bs);
this->SendXLines();