diff options
author | Adam <Adam@anope.org> | 2010-06-27 19:55:19 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-06-27 19:55:19 -0400 |
commit | 1e53c2d50a6f4a691d2f0962477722633293a7bb (patch) | |
tree | 16e62c9a51b09401970a1ca31da225456208f1a1 /src | |
parent | ccc92376beaab22558543cd3ce60782203372004 (diff) |
Removed nickserv/chanserv info all, just have info show all information
Diffstat (limited to 'src')
-rw-r--r-- | src/core/cs_info.cpp | 23 | ||||
-rw-r--r-- | src/core/ns_info.cpp | 36 |
2 files changed, 15 insertions, 44 deletions
diff --git a/src/core/cs_info.cpp b/src/core/cs_info.cpp index c437d4a15..924df4ed5 100644 --- a/src/core/cs_info.cpp +++ b/src/core/cs_info.cpp @@ -28,7 +28,7 @@ class CommandCSInfo : public Command } public: - CommandCSInfo() : Command("INFO", 1, 2) + CommandCSInfo() : Command("INFO", 1, 1) { this->SetFlag(CFLAG_ALLOW_UNREGISTERED); this->SetFlag(CFLAG_ALLOW_SUSPENDED); @@ -38,15 +38,13 @@ class CommandCSInfo : public Command CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { const char *chan = params[0].c_str(); - ci::string param = params.size() > 1 ? params[1] : ""; - ChannelInfo *ci; char buf[BUFSIZE]; struct tm *tm; bool has_auspex = u->IsIdentified() && u->Account()->HasPriv("chanserv/auspex"); bool show_all = false; time_t expt; - ci = cs_findchan(chan); + ChannelInfo *ci = cs_findchan(chan); if (ci->HasFlag(CI_FORBIDDEN)) { @@ -59,7 +57,7 @@ class CommandCSInfo : public Command } /* Should we show all fields? Only for sadmins and identified users */ - if (!param.empty() && param == "ALL" && (check_access(u, ci, CA_INFO) || has_auspex)) + if (has_auspex && check_access(u, ci, CA_INFO)) show_all = true; notice_lang(Config.s_ChanServ, u, CHAN_INFO_HEADER, chan); @@ -118,13 +116,10 @@ class CommandCSInfo : public Command notice_lang(Config.s_ChanServ, u, CHAN_INFO_NO_EXPIRE); else { - if (has_auspex) - { - expt = ci->last_used + Config.CSExpire; - tm = localtime(&expt); - strftime_lang(buf, sizeof(buf), u, STRFTIME_DATE_TIME_FORMAT, tm); - notice_lang(Config.s_ChanServ, u, CHAN_INFO_EXPIRE, buf); - } + expt = ci->last_used + Config.CSExpire; + tm = localtime(&expt); + strftime_lang(buf, sizeof(buf), u, STRFTIME_DATE_TIME_FORMAT, tm); + notice_lang(Config.s_ChanServ, u, CHAN_INFO_EXPIRE, buf); } } if (ci->HasFlag(CI_SUSPENDED)) @@ -132,16 +127,12 @@ class CommandCSInfo : public Command FOREACH_MOD(I_OnChanInfo, OnChanInfo(u, ci, show_all)); - if (!show_all && (check_access(u, ci, CA_INFO) || has_auspex)) - notice_lang(Config.s_ChanServ, u, NICK_INFO_FOR_MORE, Config.s_ChanServ, ci->name.c_str()); return MOD_CONT; } bool OnHelp(User *u, const ci::string &subcommand) { notice_lang(Config.s_ChanServ, u, CHAN_HELP_INFO); - if (u->IsIdentified() && u->Account()->HasPriv("chanserv/auspex")) - notice_lang(Config.s_ChanServ, u, CHAN_SERVADMIN_HELP_INFO); return true; } diff --git a/src/core/ns_info.cpp b/src/core/ns_info.cpp index 55e11dfce..244f8c190 100644 --- a/src/core/ns_info.cpp +++ b/src/core/ns_info.cpp @@ -29,38 +29,26 @@ class CommandNSInfo : public Command } } public: - CommandNSInfo() : Command("INFO", 1, 2) + CommandNSInfo() : Command("INFO", 1, 1) { this->SetFlag(CFLAG_ALLOW_UNREGISTERED); } CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { - /* Show hidden info to nick owners and sadmins when the "ALL" parameter is - * supplied. If a nick is online, the "Last seen address" changes to "Is - * online from". - * Syntax: INFO <nick> {ALL} - * -TheShadow (13 Mar 1999) - */ const char *nick = params[0].c_str(); - ci::string param = params.size() > 1 ? params[1] : ""; - NickAlias *na; - NickRequest *nr = NULL; - /* Being an oper is enough from now on -GD */ + NickAlias *na = findnick(nick); + bool has_auspex = u->IsIdentified() && u->Account()->HasPriv("nickserv/auspex"); - if (!(na = findnick(nick))) + if (!na) { - if ((nr = findrequestnick(nick))) + NickRequest *nr = findrequestnick(nick); + if (nr) { notice_lang(Config.s_NickServ, u, NICK_IS_PREREG); - if (!param.empty() && param == "ALL" && u->Account() && u->Account()->IsServicesOper()) + if (has_auspex) notice_lang(Config.s_NickServ, u, NICK_INFO_EMAIL, nr->email); - else - { - if (u->Account() && u->Account()->IsServicesOper()) - notice_lang(Config.s_NickServ, u, NICK_INFO_FOR_MORE, Config.s_NickServ, nr->nick); - } } else if (nickIsServices(nick, 1)) notice_lang(Config.s_NickServ, u, NICK_X_IS_SERVICES, nick); @@ -80,16 +68,13 @@ class CommandNSInfo : public Command char buf[BUFSIZE]; bool nick_online = false, show_hidden = false; time_t expt; - bool has_auspex = u->IsIdentified() && u->Account()->HasPriv("nickserv/auspex"); /* Is the real owner of the nick we're looking up online? -TheShadow */ User *u2 = finduser(na->nick); if (u2 && u2->Account() == na->nc) nick_online = true; - /* Only show hidden fields to owner and sadmins and only when the ALL - * parameter is used. -TheShadow */ - if (!param.empty() && param == "ALL" && u->Account() && (na->nc == u->Account() || has_auspex)) + if (has_auspex || (u->Account() && na->nc == u->Account())) show_hidden = true; notice_lang(Config.s_NickServ, u, NICK_INFO_REALNAME, na->nick, na->last_realname); @@ -173,9 +158,6 @@ class CommandNSInfo : public Command } FOREACH_MOD(I_OnNickInfo, OnNickInfo(u, na, show_hidden)); - - if (!show_hidden && u->Account() && (na->nc == u->Account() || has_auspex)) - notice_lang(Config.s_NickServ, u, NICK_INFO_FOR_MORE, Config.s_NickServ, na->nick); } return MOD_CONT; } @@ -183,8 +165,6 @@ class CommandNSInfo : public Command bool OnHelp(User *u, const ci::string &subcommand) { notice_help(Config.s_NickServ, u, NICK_HELP_INFO); - if (u->IsIdentified() && u->Account()->HasPriv("nickserv/auspex")) - notice_help(Config.s_NickServ, u, NICK_SERVADMIN_HELP_INFO); return true; } |