]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_zline.cpp
Move SetNoticeMask(), FormatNoticeMasks() and ProcessNoticeMasks() from the User...
[user/henk/code/inspircd.git] / src / commands / cmd_zline.cpp
index 91d9c6255962e1a10b6aecdbfda9e99370033e79..fdb156e0ab51a93049b4ffcd1f5f68607fe02026 100644 (file)
@@ -49,7 +49,7 @@ CmdResult CommandZline::Handle (const std::vector<std::string>& parameters, User
        {
                if (target.find('!') != std::string::npos)
                {
-                       user->WriteServ("NOTICE %s :*** You cannot include a nickname in a zline, a zline must ban only an IP mask",user->nick.c_str());
+                       user->WriteNotice("*** You cannot include a nickname in a zline, a zline must ban only an IP mask");
                        return CMD_FAILURE;
                }
 
@@ -72,8 +72,7 @@ CmdResult CommandZline::Handle (const std::vector<std::string>& parameters, User
                if (ServerInstance->IPMatchesEveryone(ipaddr,user))
                        return CMD_FAILURE;
 
-               long duration = ServerInstance->Duration(parameters[1].c_str());
-
+               unsigned long duration = InspIRCd::Duration(parameters[1]);
                ZLine* zl = new ZLine(ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), ipaddr);
                if (ServerInstance->XLines->AddLine(zl,user))
                {
@@ -93,7 +92,7 @@ CmdResult CommandZline::Handle (const std::vector<std::string>& parameters, User
                else
                {
                        delete zl;
-                       user->WriteServ("NOTICE %s :*** Z-Line for %s already exists",user->nick.c_str(),ipaddr);
+                       user->WriteNotice("*** Z-Line for " + std::string(ipaddr) + " already exists");
                }
        }
        else
@@ -104,7 +103,7 @@ CmdResult CommandZline::Handle (const std::vector<std::string>& parameters, User
                }
                else
                {
-                       user->WriteServ("NOTICE %s :*** Z-Line %s not found in list, try /stats Z.",user->nick.c_str(),target.c_str());
+                       user->WriteNotice("*** Z-Line " + target + " not found in list, try /stats Z.");
                        return CMD_FAILURE;
                }
        }