diff options
| author | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-02-08 03:09:19 +0000 |
|---|---|---|
| committer | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-02-08 03:09:19 +0000 |
| commit | 512b5bdaf3b9de1c1cb1d78b921269f78b82e97b (patch) | |
| tree | 2435caac310109ddcc04bcef4595b60245f5fb8a /src/core | |
| parent | f4db8c5360a71bf2c815602ade39800033f7ae16 (diff) | |
Rewrote & fixed CAPAB support
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2786 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/os_stats.c | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/src/core/os_stats.c b/src/core/os_stats.c index ade762e0c..4ff9617ae 100644 --- a/src/core/os_stats.c +++ b/src/core/os_stats.c @@ -202,32 +202,21 @@ class CommandOSStats : public Command CommandReturn DoStatsUplink(User *u) { - char buf[512] = ""; - int i; - for (i = 0; capab_info[i].token; ++i) + std::string buf; + + for (unsigned j = 0; !Capab_Info[j].Token.empty(); ++j) { - if (uplink_capab & capab_info[i].flag) + if (Capab.HasFlag(Capab_Info[j].Flag)) { - strlcat(buf, " ", sizeof(buf)); - strlcat(buf, capab_info[i].token, sizeof(buf)); - /* Special cases */ - if (capab_info[i].flag == CAPAB_CHANMODE) - { - strlcat(buf, "=", sizeof(buf)); - strlcat(buf, ircd->chanmodes, sizeof(buf)); - } - if (capab_info[i].flag == CAPAB_NICKCHARS) - { - strlcat(buf, "=", sizeof(buf)); - if (ircd->nickchars) - { - strlcat(buf, ircd->nickchars, sizeof(buf)); - } /* leave blank if it was null */ - } + buf += " " + Capab_Info[j].Token; } } + + if (!buf.empty()) + buf.erase(buf.begin()); + notice_lang(Config.s_OperServ, u, OPER_STATS_UPLINK_SERVER, serv_uplink->name); - notice_lang(Config.s_OperServ, u, OPER_STATS_UPLINK_CAPAB, buf); + notice_lang(Config.s_OperServ, u, OPER_STATS_UPLINK_CAPAB, buf.c_str()); notice_lang(Config.s_OperServ, u, OPER_STATS_UPLINK_SERVER_COUNT, stats_count_servers(serv_uplink)); return MOD_CONT; } |
