]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_shun.cpp
Only send ACCOUNT and CHGHOST to clients that have sent NICK/USER.
[user/henk/code/inspircd.git] / src / modules / m_shun.cpp
index cd2743ab09d1bbfbbbed25db1632f517ee3542cc..6414b01e79cf2259f3951f070f50fc57269bcac0 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
@@ -81,7 +81,7 @@ class CommandShun : public Command
                        }
                        else
                        {
-                               user->WriteNotice("*** Shun " + parameters[0] + " not found in list, try /stats H.");
+                               user->WriteNotice("*** Shun " + parameters[0] + " not found on the list.");
                                return CMD_FAILURE;
                        }
                }
@@ -110,15 +110,14 @@ class CommandShun : public Command
                        {
                                if (!duration)
                                {
-                                       ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent SHUN for %s: %s",
+                                       ServerInstance->SNO->WriteToSnoMask('x', "%s added permanent SHUN for %s: %s",
                                                user->nick.c_str(), target.c_str(), expr.c_str());
                                }
                                else
                                {
-                                       time_t c_requires_crap = duration + ServerInstance->Time();
-                                       std::string timestr = InspIRCd::TimeString(c_requires_crap);
-                                       ServerInstance->SNO->WriteToSnoMask('x', "%s added timed SHUN for %s to expire on %s: %s",
-                                               user->nick.c_str(), target.c_str(), timestr.c_str(), expr.c_str());
+                                       ServerInstance->SNO->WriteToSnoMask('x', "%s added timed SHUN for %s, expires in %s (on %s): %s",
+                                               user->nick.c_str(), target.c_str(), InspIRCd::DurationString(duration).c_str(),
+                                               InspIRCd::TimeString(ServerInstance->Time() + duration).c_str(), expr.c_str());
                                }
                        }
                        else
@@ -245,7 +244,7 @@ class ModuleShun : public Module, public Stats::EventListener
 
        Version GetVersion() CXX11_OVERRIDE
        {
-               return Version("Provides the /SHUN command, which stops a user from executing all except configured commands.",VF_VENDOR|VF_COMMON);
+               return Version("Provides the SHUN command, which stops a user from executing all except configured commands", VF_VENDOR|VF_COMMON);
        }
 };