diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-07-09 15:40:49 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-07-09 15:40:49 +0200 |
commit | 713fa43b98b5f4de918253f6fc735cd8542e25e3 (patch) | |
tree | 7a3c39f63c84a31d84c7f5f88c01a5acbf2a04fd /src/coremods | |
parent | da877e4750333f02c48a667241a41412c38bfd16 (diff) |
core_whowas Return a WhoWas::Manager::Stats struct from GetStats() instead of a string
Diffstat (limited to 'src/coremods')
-rw-r--r-- | src/coremods/core_whowas.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/coremods/core_whowas.cpp b/src/coremods/core_whowas.cpp index fee40377a..18c419c75 100644 --- a/src/coremods/core_whowas.cpp +++ b/src/coremods/core_whowas.cpp @@ -88,7 +88,7 @@ const WhoWas::Nick* WhoWas::Manager::FindNick(const std::string& nickname) const return nick; } -std::string WhoWas::Manager::GetStats() const +WhoWas::Manager::Stats WhoWas::Manager::GetStats() const { size_t entrycount = 0; for (whowas_users::const_iterator i = whowas.begin(); i != whowas.end(); ++i) @@ -96,7 +96,10 @@ std::string WhoWas::Manager::GetStats() const WhoWas::Nick::List& list = i->second->entries; entrycount += list.size(); } - return "Whowas entries: " + ConvToStr(entrycount); + + Stats stats; + stats.entrycount = entrycount; + return stats; } void WhoWas::Manager::Add(User* user) @@ -259,7 +262,7 @@ class ModuleWhoWas : public Module ModResult OnStats(char symbol, User* user, string_list &results) { if (symbol == 'z') - results.push_back("249 "+user->nick+" :"+cmd.manager.GetStats()); + results.push_back("249 "+user->nick+" :Whowas entries: "+ConvToStr(cmd.manager.GetStats().entrycount)); return MOD_RES_PASSTHRU; } |