From 7ae7ccb556416b2f12e41a65579719ab2a3e1ed5 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 4 Nov 2007 14:18:42 +0000 Subject: 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 --- src/users.cpp | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'src') 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; } } -- cgit v1.2.3