summaryrefslogtreecommitdiff
path: root/src/modules/m_cban.cpp
diff options
context:
space:
mode:
authorom <om@e03df62e-2008-0410-955e-edbf42e46eb7>2006-01-31 00:11:23 +0000
committerom <om@e03df62e-2008-0410-955e-edbf42e46eb7>2006-01-31 00:11:23 +0000
commit94d1d02c4c43ad3a77529cfef15a18a576a4d0f2 (patch)
tree5090c1904fffff658bdc43b3312895fd2b33248b /src/modules/m_cban.cpp
parentee37ec258aeaff7086d75682ea3b75da480cea75 (diff)
Some changes to some stuff..
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2996 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_cban.cpp')
-rw-r--r--src/modules/m_cban.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp
index ae0961f29..8ddfcc159 100644
--- a/src/modules/m_cban.cpp
+++ b/src/modules/m_cban.cpp
@@ -98,19 +98,21 @@ class cmd_cban : public command_t
// parameters[1] = 1h3m2s
// parameters[2] = Tortoise abuser
long length = Srv->CalcDuration(parameters[1]);
+ std::string reason = (pcnt > 2) ? parameters[2] : "No reason supplied";
- cbans.push_back(CBan(parameters[0], user->nick, TIME, length, parameters[2]));
+ cbans.push_back(CBan(parameters[0], user->nick, TIME, length, reason));
+
std::sort(cbans.begin(), cbans.end(), CBanComp);
if(length > 0)
{
- WriteServ(user->fd, "385 %s %s :Added %lu second channel ban (%s)", user->nick, parameters[0], length, parameters[2]);
- WriteOpers("*** %s added %lu second channel ban on %s (%s)", user->nick, length, parameters[0], parameters[2]);
+ WriteServ(user->fd, "385 %s %s :Added %lu second channel ban (%s)", user->nick, parameters[0], length, reason.c_str());
+ WriteOpers("*** %s added %lu second channel ban on %s (%s)", user->nick, length, parameters[0], reason.c_str());
}
else
{
- WriteServ(user->fd, "385 %s %s :Added permenant channel ban (%s)", user->nick, parameters[0], parameters[2]);
- WriteOpers("*** %s added permenant channel ban on %s (%s)", user->nick, parameters[0], parameters[2]);
+ WriteServ(user->fd, "385 %s %s :Added permenant channel ban (%s)", user->nick, parameters[0], reason.c_str());
+ WriteOpers("*** %s added permenant channel ban on %s (%s)", user->nick, parameters[0], reason.c_str());
}
}
else
@@ -143,10 +145,13 @@ class ModuleCBan : public Module
{
ExpireBans();
- for(cbanlist::iterator iter = cbans.begin(); iter != cbans.end(); iter++)
+ if(symbol == 'C')
{
- unsigned long remaining = (iter->set_on + iter->length) - TIME;
- WriteServ(user->fd, "210 %s %s %s %lu %lu %lu :%s", user->nick, iter->chname.c_str(), iter->set_by.c_str(), iter->set_on, iter->length, remaining, iter->reason.c_str());
+ for(cbanlist::iterator iter = cbans.begin(); iter != cbans.end(); iter++)
+ {
+ unsigned long remaining = (iter->set_on + iter->length) - TIME;
+ WriteServ(user->fd, "210 %s %s %s %lu %lu %lu :%s", user->nick, iter->chname.c_str(), iter->set_by.c_str(), iter->set_on, iter->length, remaining, iter->reason.c_str());
+ }
}
return 0;