summaryrefslogtreecommitdiff
path: root/src/xline.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-10-28 21:14:41 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-10-28 21:14:41 +0000
commit774747d8acc5d04d60c966eff91e1a9b81f2526b (patch)
tree91241870da5ff32f002db787ee54d9e33d379dc8 /src/xline.cpp
parent02a1173a5e689bf26bb1c2942de39a80e14a37c9 (diff)
Add Apply and DefaultApply.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8412 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/xline.cpp')
-rw-r--r--src/xline.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/xline.cpp b/src/xline.cpp
index 428ea2c16..115ab0da6 100644
--- a/src/xline.cpp
+++ b/src/xline.cpp
@@ -693,6 +693,22 @@ bool XLine::Matches(const std::string &str)
return false;
}
+void XLine::Apply(User* u)
+{
+}
+
+void XLine::DefaultApply(User* u, char line)
+{
+ char reason[MAXBUF];
+ snprintf(reason, MAXBUF, "%c-Lined: %s", line, this->reason);
+ if (*ServerInstance->Config->MoronBanner)
+ u->WriteServ("NOTICE %s :*** %s", u->nick, ServerInstance->Config->MoronBanner);
+ if (ServerInstance->Config->HideBans)
+ User::QuitUser(ServerInstance, u, line + std::string("-Lined"), reason);
+ else
+ User::QuitUser(ServerInstance, u, reason);
+}
+
bool KLine::Matches(User *u)
{
if ((match(u->ident, this->identmask)))
@@ -706,6 +722,11 @@ bool KLine::Matches(User *u)
return false;
}
+void KLine::Apply(User* u)
+{
+ DefaultApply(u, 'K');
+}
+
bool GLine::Matches(User *u)
{
if ((match(u->ident, this->identmask)))
@@ -719,6 +740,11 @@ bool GLine::Matches(User *u)
return false;
}
+void GLine::Apply(User* u)
+{
+ DefaultApply(u, 'G');
+}
+
bool ELine::Matches(User *u)
{
if ((match(u->ident, this->identmask)))
@@ -740,6 +766,12 @@ bool ZLine::Matches(User *u)
return false;
}
+void ZLine::Apply(User* u)
+{
+ DefaultApply(u, 'Z');
+}
+
+
bool QLine::Matches(User *u)
{
if (match(u->nick, this->nick))
@@ -748,6 +780,13 @@ bool QLine::Matches(User *u)
return false;
}
+void QLine::Apply(User* u)
+{
+ /* Can we force the user to their uid here instead? */
+ DefaultApply(u, 'Q');
+}
+
+
bool ZLine::Matches(const std::string &str)
{
if (match(str.c_str(), this->ipaddr, true))