]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_dccallow.cpp
Some more text fixes and improvements (#1618).
[user/henk/code/inspircd.git] / src / modules / m_dccallow.cpp
index 85f9d20d09ec3c379fc26afc357f56d6e4730ad6..e0ea4c7aeed89e7d20ab38cdc05bb0320e4e8ff5 100644 (file)
@@ -54,7 +54,7 @@ static const char* const helptext[] =
        "Brain would then be able to send you files. They would have to",
        "resend the file again if the server gave them an error message",
        "before you added them to your DCCALLOW list.",
-       "DCCALLOW entries will be temporary by default, if you want to add",
+       "DCCALLOW entries will be temporary. If you want to add",
        "them to your DCCALLOW list until you leave IRC, type:",
        "/DCCALLOW +Brain 0",
        "To remove the user from your DCCALLOW list, type:",
@@ -63,7 +63,7 @@ static const char* const helptext[] =
        "/DCCALLOW LIST",
        "NOTE: If the user leaves IRC or changes their nickname",
        "  they will be removed from your DCCALLOW list.",
-       "  your DCCALLOW list will be deleted when you leave IRC."
+       "  Your DCCALLOW list will be deleted when you leave IRC."
 };
 
 class BannedFileList
@@ -117,7 +117,7 @@ class CommandDccallow : public Command
 
        CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE
        {
-               /* syntax: DCCALLOW [+|-]<nick> (<time>) */
+               /* syntax: DCCALLOW [(+|-)<nick> [<time>]]|[LIST|HELP] */
                if (!parameters.size())
                {
                        // display current DCCALLOW list
@@ -219,7 +219,11 @@ class CommandDccallow : public Command
                                        }
                                        else
                                        {
-                                               length = InspIRCd::Duration(parameters[1]);
+                                               if (!InspIRCd::Duration(parameters[1], length))
+                                               {
+                                                       user->WriteNotice("*** Invalid duration for DCC allow");
+                                                       return CMD_FAILURE;
+                                               }
                                        }
 
                                        if (!InspIRCd::IsValidMask(mask))
@@ -231,7 +235,7 @@ class CommandDccallow : public Command
 
                                        if (length > 0)
                                        {
-                                               user->WriteNumeric(RPL_DCCALLOWTIMED, user->nick, InspIRCd::Format("Added %s to DCCALLOW list for %ld seconds", target->nick.c_str(), length));
+                                               user->WriteNumeric(RPL_DCCALLOWTIMED, user->nick, InspIRCd::Format("Added %s to DCCALLOW list for %s", target->nick.c_str(), InspIRCd::DurationString(length).c_str()));
                                        }
                                        else
                                        {
@@ -525,7 +529,7 @@ class ModuleDCCAllow : public Module
 
        Version GetVersion() CXX11_OVERRIDE
        {
-               return Version("Provides support for the /DCCALLOW command", VF_COMMON | VF_VENDOR);
+               return Version("Provides the DCCALLOW command", VF_COMMON | VF_VENDOR);
        }
 };