summaryrefslogtreecommitdiff
path: root/src/xline.cpp
diff options
context:
space:
mode:
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))