]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_svshold.cpp
Fix Doxygen syntax errors.
[user/henk/code/inspircd.git] / src / modules / m_svshold.cpp
index a38776d8db7a501a7a8f1fefe20a19cb4cccfce9..37288a32299433549be19abf525b44f443ee5491 100644 (file)
@@ -81,6 +81,11 @@ class SVSHoldFactory : public XLineFactory
        {
                return new SVSHold(set_time, duration, source, reason, xline_specific_mask);
        }
+
+       bool AutoApplyToUserList(XLine *x)
+       {
+               return false;
+       }
 };
 
 /** Handle /SVSHold
@@ -115,45 +120,30 @@ class CommandSvshold : public Command
                        {
                                user->WriteServ("NOTICE %s :*** SVSHOLD %s not found in list, try /stats S.",user->nick.c_str(),parameters[0].c_str());
                        }
-
-                       return CMD_SUCCESS;
                }
-               else if (parameters.size() >= 2)
+               else
                {
                        // Adding - XXX todo make this respect <insane> tag perhaps..
                        long duration = ServerInstance->Duration(parameters[1]);
-                       SVSHold *r = NULL;
+                       SVSHold* r = new SVSHold(ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), parameters[0].c_str());
 
-                       try
-                       {
-                               r = new SVSHold(ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), parameters[0].c_str());
-                       }
-                       catch (...)
+                       if (ServerInstance->XLines->AddLine(r, user))
                        {
-                               ; // Do nothing.
-                       }
-
-                       if (r)
-                       {
-                               if (ServerInstance->XLines->AddLine(r, user))
+                               if (!duration)
                                {
-                                       if (!duration)
-                                       {
-                                               ServerInstance->SNO->WriteGlobalSno('x', "%s added permanent SVSHOLD for %s: %s", user->nick.c_str(), parameters[0].c_str(), parameters[2].c_str());
-                                       }
-                                       else
-                                       {
-                                               time_t c_requires_crap = duration + ServerInstance->Time();
-                                               ServerInstance->SNO->WriteGlobalSno('x', "%s added timed SVSHOLD for %s, expires on %s: %s", user->nick.c_str(), parameters[0].c_str(), ServerInstance->TimeString(c_requires_crap).c_str(), parameters[2].c_str());
-                                       }
-
-                                       ServerInstance->XLines->ApplyLines();
+                                       ServerInstance->SNO->WriteGlobalSno('x', "%s added permanent SVSHOLD for %s: %s", user->nick.c_str(), parameters[0].c_str(), parameters[2].c_str());
                                }
                                else
                                {
-                                       delete r;
+                                       time_t c_requires_crap = duration + ServerInstance->Time();
+                                       ServerInstance->SNO->WriteGlobalSno('x', "%s added timed SVSHOLD for %s, expires on %s: %s", user->nick.c_str(), parameters[0].c_str(), ServerInstance->TimeString(c_requires_crap).c_str(), parameters[2].c_str());
                                }
                        }
+                       else
+                       {
+                               delete r;
+                               return CMD_FAILURE;
+                       }
                }
 
                return CMD_SUCCESS;
@@ -161,7 +151,7 @@ class CommandSvshold : public Command
 
        RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
        {
-               return ROUTE_BROADCAST;
+               return ROUTE_LOCALONLY;
        }
 };