summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modules/m_cban.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp
index e9cf1ce0a..32a2e99a2 100644
--- a/src/modules/m_cban.cpp
+++ b/src/modules/m_cban.cpp
@@ -111,10 +111,11 @@ class CommandCBan : public Command
// Adding - XXX todo make this respect <insane> tag perhaps..
long duration = ServerInstance->Duration(parameters[1]);
CBan *r = NULL;
+ const char *reason = (parameters.size() > 2) ? parameters[2].c_str() : "No reason supplied";
try
{
- r = new CBan(ServerInstance, ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), parameters[0].c_str());
+ r = new CBan(ServerInstance, ServerInstance->Time(), duration, user->nick.c_str(), reason, parameters[0].c_str());
}
catch (...)
{
@@ -127,12 +128,12 @@ class CommandCBan : public Command
{
if (!duration)
{
- ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent CBan for %s: %s", user->nick.c_str(), parameters[0].c_str(), parameters[2].c_str());
+ ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent CBan for %s: %s", user->nick.c_str(), parameters[0].c_str(), reason);
}
else
{
time_t c_requires_crap = duration + ServerInstance->Time();
- ServerInstance->SNO->WriteToSnoMask('x', "%s added timed CBan 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->SNO->WriteToSnoMask('x', "%s added timed CBan for %s, expires on %s: %s", user->nick.c_str(), parameters[0].c_str(), ServerInstance->TimeString(c_requires_crap).c_str(), reason);
}
ServerInstance->XLines->ApplyLines();