summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_svshold.cpp46
1 files changed, 18 insertions, 28 deletions
diff --git a/src/modules/m_svshold.cpp b/src/modules/m_svshold.cpp
index a38776d8d..37288a322 100644
--- a/src/modules/m_svshold.cpp
+++ b/src/modules/m_svshold.cpp
@@ -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;
}
};