From f690cd802ecbf540732e35e44a757adb4699a48d Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 2 Aug 2011 02:02:13 -0400 Subject: [PATCH] Made /ns info default to your account or your nick if no arguments are given --- modules/core/ns_info.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/core/ns_info.cpp b/modules/core/ns_info.cpp index 5a1c4520b..e2c45958f 100644 --- a/modules/core/ns_info.cpp +++ b/modules/core/ns_info.cpp @@ -28,18 +28,18 @@ class CommandNSInfo : public Command } } public: - CommandNSInfo(Module *creator) : Command(creator, "nickserv/info", 1, 2) + CommandNSInfo(Module *creator) : Command(creator, "nickserv/info", 0, 2) { this->SetFlag(CFLAG_ALLOW_UNREGISTERED); this->SetDesc(_("Displays information about a given nickname")); - this->SetSyntax(_("\037nickname\037")); + this->SetSyntax(_("[\037nickname\037]")); } void Execute(CommandSource &source, const std::vector ¶ms) { User *u = source.u; - const Anope::string &nick = params[0]; + const Anope::string &nick = params.size() ? params[0] : (u->Account() ? u->Account()->display : u->nick); NickAlias *na = findnick(nick); bool has_auspex = u->IsIdentified() && u->HasPriv("nickserv/auspex"); @@ -148,7 +148,9 @@ class CommandNSInfo : public Command source.Reply(" "); source.Reply(_("Displays information about the given nickname, such as\n" "the nick's owner, last seen address and time, and nick\n" - "options.")); + "options. If no nick is given, an you are identified,\n" + "your account name is used, else your current nickname is\n" + "used.")); return true; }