summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-11-04 14:18:42 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-11-04 14:18:42 +0000
commit7ae7ccb556416b2f12e41a65579719ab2a3e1ed5 (patch)
tree9ae65ba5e8d21b85198b0c6226e380342db14cda
parentf39ed764320d2f279235ce1f8084c7bca3ccf2cf (diff)
Avoid code duplication, just call XLine::Apply() rather than retyping all that moronbanner stuff each time
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8494 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/users.cpp18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/users.cpp b/src/users.cpp
index 34c7735fe..e66ac7fd9 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -863,11 +863,7 @@ void User::AddClient(InspIRCd* Instance, int socket, int port, bool iscached, in
{
Instance->Log(DEBUG, std::string("BanCache: Adding positive hit for ") + New->GetIPString());
Instance->BanCache->AddHit(New->GetIPString(), "Z", std::string("Z-Lined: ") + r->reason);
- char reason[MAXBUF];
- if (*Instance->Config->MoronBanner)
- New->WriteServ("NOTICE %s :*** %s", New->nick, Instance->Config->MoronBanner);
- snprintf(reason,MAXBUF,"Z-Lined: %s",r->reason);
- User::QuitUser(Instance, New, reason);
+ r->Apply(New);
return;
}
}
@@ -974,11 +970,7 @@ void User::FullConnect()
if (r)
{
this->muted = true;
- char reason[MAXBUF];
- if (*ServerInstance->Config->MoronBanner)
- this->WriteServ("NOTICE %s :*** %s", this->nick, ServerInstance->Config->MoronBanner);
- snprintf(reason,MAXBUF,"G-Lined: %s",r->reason);
- User::QuitUser(ServerInstance, this, reason);
+ r->Apply(this);
return;
}
@@ -987,11 +979,7 @@ void User::FullConnect()
if (n)
{
this->muted = true;
- char reason[MAXBUF];
- if (*ServerInstance->Config->MoronBanner)
- this->WriteServ("NOTICE %s :*** %s", this, ServerInstance->Config->MoronBanner);
- snprintf(reason,MAXBUF,"K-Lined: %s",n->reason);
- User::QuitUser(ServerInstance, this, reason);
+ n->Apply(this);
return;
}
}