summaryrefslogtreecommitdiff
path: root/src/xline.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-10-28 21:20:09 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-10-28 21:20:09 +0000
commite8df3f491d67bc520f808c8b9ebfb54cfc1cce74 (patch)
tree0670c2ae78fdbc630921d21f0ceac25e00c77ac6 /src/xline.cpp
parent402bb37950becc1577d7daf6cd6f088d01234010 (diff)
YAR!
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8415 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/xline.cpp')
-rw-r--r--src/xline.cpp85
1 files changed, 3 insertions, 82 deletions
diff --git a/src/xline.cpp b/src/xline.cpp
index 0c93faf39..cb905440f 100644
--- a/src/xline.cpp
+++ b/src/xline.cpp
@@ -547,9 +547,6 @@ void XLineManager::expire_lines()
void XLineManager::ApplyLines()
{
- char reason[MAXBUF];
-
- XLine* check = NULL;
for (std::vector<User*>::const_iterator u2 = ServerInstance->local_users.begin(); u2 != ServerInstance->local_users.end(); u2++)
{
User* u = (User*)(*u2);
@@ -564,85 +561,9 @@ void XLineManager::ApplyLines()
for (std::vector<XLine *>::iterator i = pending_lines.begin(); i != pending_lines.end(); i++)
{
- XLine *x = (*i);
-
- switch (x->type)
- {
- case 'Z':
- {
- ZLine *z = dynamic_cast<ZLine *>(x);
-
- if (z->Matches(u))
- {
- snprintf(reason,MAXBUF,"Z-Lined: %s", check->reason);
- if (*ServerInstance->Config->MoronBanner)
- u->WriteServ("NOTICE %s :*** %s", u->nick, ServerInstance->Config->MoronBanner);
- if (ServerInstance->Config->HideBans)
- User::QuitUser(ServerInstance, u, "Z-Lined", reason);
- else
- User::QuitUser(ServerInstance, u, reason);
- }
- break;
- }
- case 'G':
- {
- GLine *g = dynamic_cast<GLine *>(x);
-
- if (g->Matches(u))
- {
- snprintf(reason,MAXBUF,"G-Lined: %s",check->reason);
- if (*ServerInstance->Config->MoronBanner)
- u->WriteServ("NOTICE %s :*** %s", u->nick, ServerInstance->Config->MoronBanner);
- if (ServerInstance->Config->HideBans)
- User::QuitUser(ServerInstance, u, "G-Lined", reason);
- else
- User::QuitUser(ServerInstance, u, reason);
- }
- break;
- }
- case 'Q':
- {
- QLine *q = dynamic_cast<QLine *>(x);
-
- if (q->Matches(u))
- {
- snprintf(reason,MAXBUF,"Q-Lined: %s",check->reason);
- if (*ServerInstance->Config->MoronBanner)
- u->WriteServ("NOTICE %s :*** %s", u->nick, ServerInstance->Config->MoronBanner);
- if (ServerInstance->Config->HideBans)
- User::QuitUser(ServerInstance, u, "Q-Lined", reason);
- else
- User::QuitUser(ServerInstance, u, reason);
- }
- break;
- }
- case 'K':
- {
- KLine *k = dynamic_cast<KLine *>(x);
-
- if (k->Matches(u))
- {
- snprintf(reason,MAXBUF,"K-Lined: %s",check->reason);
- if (*ServerInstance->Config->MoronBanner)
- u->WriteServ("NOTICE %s :*** %s", u->nick, ServerInstance->Config->MoronBanner);
- if (ServerInstance->Config->HideBans)
- User::QuitUser(ServerInstance, u, "K-Lined", reason);
- else
- User::QuitUser(ServerInstance, u, reason);
- }
- break;
- }
- case 'E':
- {
-// ELine *e = dynamic_cast<ELine *>(x);
- break;
- }
- default:
- {
- ServerInstance->Log(DEBUG, "Unknown line type pending: %c", x->type);
- break;
- }
- }
+ XLine *x = *i;
+ if (x->Matches(u))
+ x->Apply(u);
}
}