]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_shun.cpp
X-line expiries: use the new DurationString() function.
[user/henk/code/inspircd.git] / src / modules / m_shun.cpp
index e4fb2c11d0fd71d4fb81d0e525331cfcc54364dc..e54156da6aff01d9fa5262a9a9c7e7f34a4b22a2 100644 (file)
@@ -53,7 +53,7 @@ class CommandShun : public Command
  public:
        CommandShun(Module* Creator) : Command(Creator, "SHUN", 1, 3)
        {
-               flags_needed = 'o'; this->syntax = "<nick!user@hostmask> [<shun-duration>] :<reason>";
+               flags_needed = 'o'; this->syntax = "<nick!user@host> [<duration> :<reason>]";
        }
 
        CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE
@@ -69,13 +69,15 @@ class CommandShun : public Command
 
                if (parameters.size() == 1)
                {
-                       if (ServerInstance->XLines->DelLine(parameters[0].c_str(), "SHUN", user))
+                       std::string reason;
+
+                       if (ServerInstance->XLines->DelLine(parameters[0].c_str(), "SHUN", reason, user))
                        {
-                               ServerInstance->SNO->WriteToSnoMask('x', "%s removed SHUN on %s", user->nick.c_str(), parameters[0].c_str());
+                               ServerInstance->SNO->WriteToSnoMask('x', "%s removed SHUN on %s: %s", user->nick.c_str(), parameters[0].c_str(), reason.c_str());
                        }
-                       else if (ServerInstance->XLines->DelLine(target.c_str(), "SHUN", user))
+                       else if (ServerInstance->XLines->DelLine(target.c_str(), "SHUN", reason, user))
                        {
-                               ServerInstance->SNO->WriteToSnoMask('x',"%s removed SHUN on %s", user->nick.c_str(), target.c_str());
+                               ServerInstance->SNO->WriteToSnoMask('x', "%s removed SHUN on %s: %s", user->nick.c_str(), target.c_str(), reason.c_str());
                        }
                        else
                        {
@@ -92,7 +94,7 @@ class CommandShun : public Command
                        {
                                if (!InspIRCd::Duration(parameters[1], duration))
                                {
-                                       user->WriteNotice("*** Invalid duration for SHUN");
+                                       user->WriteNotice("*** Invalid duration for SHUN.");
                                        return CMD_FAILURE;
                                }
                                expr = parameters[2];
@@ -122,7 +124,7 @@ class CommandShun : public Command
                        else
                        {
                                delete r;
-                               user->WriteNotice("*** Shun for " + target + " already exists");
+                               user->WriteNotice("*** Shun for " + target + " already exists.");
                                return CMD_FAILURE;
                        }
                }