]> 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 6453ace81485958a0060e4c4d28adbc2d4a3202f..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
                        {