summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree/override_stats.cpp
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2012-07-04 20:26:24 +0200
committerattilamolnar <attilamolnar@hush.com>2012-10-02 23:44:21 +0200
commit6b929c6dbb3d36c3873ab9911ad4d8a46ddbdc99 (patch)
tree1affc94bfd9d6dc99f6fe7e9010ff8ca331aebac /src/modules/m_spanningtree/override_stats.cpp
parenta3313987f31a074a4f5f1d455df1ee15a81362b4 (diff)
m_spanningtree Use iterators in CAPAB handler and when generating reply to spanningtree related /stats, use std::find() in TreeServer::DelChild()
Diffstat (limited to 'src/modules/m_spanningtree/override_stats.cpp')
-rw-r--r--src/modules/m_spanningtree/override_stats.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/modules/m_spanningtree/override_stats.cpp b/src/modules/m_spanningtree/override_stats.cpp
index 83691c151..688661b80 100644
--- a/src/modules/m_spanningtree/override_stats.cpp
+++ b/src/modules/m_spanningtree/override_stats.cpp
@@ -33,11 +33,12 @@ ModResult ModuleSpanningTree::OnStats(char statschar, User* user, string_list &r
{
if ((statschar == 'c') || (statschar == 'n'))
{
- for (unsigned int i = 0; i < Utils->LinkBlocks.size(); i++)
+ for (std::vector<reference<Link> >::iterator i = Utils->LinkBlocks.begin(); i != Utils->LinkBlocks.end(); ++i)
{
- results.push_back(std::string(ServerInstance->Config->ServerName)+" 213 "+user->nick+" "+statschar+" *@"+(Utils->LinkBlocks[i]->HiddenFromStats ? "<hidden>" : Utils->LinkBlocks[i]->IPAddr)+" * "+Utils->LinkBlocks[i]->Name.c_str()+" "+ConvToStr(Utils->LinkBlocks[i]->Port)+" "+(Utils->LinkBlocks[i]->Hook.empty() ? "plaintext" : Utils->LinkBlocks[i]->Hook));
+ Link* L = *i;
+ results.push_back(std::string(ServerInstance->Config->ServerName)+" 213 "+user->nick+" "+statschar+" *@"+(L->HiddenFromStats ? "<hidden>" : L->IPAddr)+" * "+(*i)->Name.c_str()+" "+ConvToStr(L->Port)+" "+(L->Hook.empty() ? "plaintext" : L->Hook));
if (statschar == 'c')
- results.push_back(std::string(ServerInstance->Config->ServerName)+" 244 "+user->nick+" H * * "+Utils->LinkBlocks[i]->Name.c_str());
+ results.push_back(std::string(ServerInstance->Config->ServerName)+" 244 "+user->nick+" H * * "+L->Name.c_str());
}
return MOD_RES_DENY;
}