]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/xline.cpp
Remote server PRIVMSG/NOTICE to nickname support
[user/henk/code/inspircd.git] / src / xline.cpp
index 1dda8dac01181102e2acb5bbf4aaef5284422fa5..3f0ddbf2b14104ae6f34db8d7c957a96454f93a6 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
  * See: http://www.inspircd.org/wiki/index.php/Credits
  *
  * This program is free but copyrighted software; see
@@ -70,7 +70,7 @@ void XLineManager::CheckELines()
        if (ELines.empty())
                return;
 
-       for (std::vector<User*>::const_iterator u2 = ServerInstance->local_users.begin(); u2 != ServerInstance->local_users.end(); u2++)
+       for (std::vector<User*>::const_iterator u2 = ServerInstance->Users->local_users.begin(); u2 != ServerInstance->Users->local_users.end(); u2++)
        {
                User* u = (User*)(*u2);
 
@@ -139,6 +139,7 @@ IdentHostPair XLineManager::IdentSplit(const std::string &ident_and_host)
        }
        else
        {
+               n.first = "";
                n.second = ident_and_host;
        }
 
@@ -203,7 +204,7 @@ bool XLineManager::DelLine(const char* hostmask, const std::string &type, User*
 void ELine::Unset()
 {
        /* remove exempt from everyone and force recheck after deleting eline */
-       for (std::vector<User*>::const_iterator u2 = ServerInstance->local_users.begin(); u2 != ServerInstance->local_users.end(); u2++)
+       for (std::vector<User*>::const_iterator u2 = ServerInstance->Users->local_users.begin(); u2 != ServerInstance->Users->local_users.end(); u2++)
        {
                User* u = (User*)(*u2);
                u->exempt = false;
@@ -310,7 +311,7 @@ void XLineManager::ExpireLine(ContainerIter container, LookupIter item)
 // applies lines, removing clients and changing nicks etc as applicable
 void XLineManager::ApplyLines()
 {
-       for (std::vector<User*>::const_iterator u2 = ServerInstance->local_users.begin(); u2 != ServerInstance->local_users.end(); u2++)
+       for (std::vector<User*>::const_iterator u2 = ServerInstance->Users->local_users.begin(); u2 != ServerInstance->Users->local_users.end(); u2++)
        {
                User* u = (User*)(*u2);
 
@@ -390,21 +391,26 @@ void XLine::Apply(User* u)
 {
 }
 
+bool XLine::IsBurstable()
+{
+       return true;
+}
+
 void XLine::DefaultApply(User* u, const std::string &line, bool bancache)
 {
-       char reason[MAXBUF];
-       snprintf(reason, MAXBUF, "%s-Lined: %s", line.c_str(), this->reason);
+       char sreason[MAXBUF];
+       snprintf(sreason, MAXBUF, "%s-Lined: %s", line.c_str(), 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 + "-Lined", reason);
+               User::QuitUser(ServerInstance, u, line + "-Lined", sreason);
        else
-               User::QuitUser(ServerInstance, u, reason);
+               User::QuitUser(ServerInstance, u, sreason);
 
 
        if (bancache)
        {
-               ServerInstance->Log(DEBUG, std::string("BanCache: Adding positive hit (") + line + ") for " + u->GetIPString());
+               ServerInstance->Logs->Log("BANCACHE", DEBUG, std::string("BanCache: Adding positive hit (") + line + ") for " + u->GetIPString());
                ServerInstance->BanCache->AddHit(u->GetIPString(), this->type, line + "-Lined: " + this->reason);
        }
 }
@@ -536,7 +542,7 @@ bool GLine::Matches(const std::string &str)
 void ELine::OnAdd()
 {
        /* When adding one eline, only check the one eline */
-       for (std::vector<User*>::const_iterator u2 = ServerInstance->local_users.begin(); u2 != ServerInstance->local_users.end(); u2++)
+       for (std::vector<User*>::const_iterator u2 = ServerInstance->Users->local_users.begin(); u2 != ServerInstance->Users->local_users.end(); u2++)
        {
                User* u = (User*)(*u2);
                if (this->Matches(u))
@@ -546,27 +552,27 @@ void ELine::OnAdd()
 
 void ELine::DisplayExpiry()
 {
-       ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed E-Line %s@%s (set by %s %d seconds ago)",this->identmask,this->hostmask,this->source,this->duration);
+       ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed E-Line %s@%s (set by %s %ld seconds ago)",this->identmask,this->hostmask,this->source,this->duration);
 }
 
 void QLine::DisplayExpiry()
 {
-       ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed Q-Line %s (set by %s %d seconds ago)",this->nick,this->source,this->duration);
+       ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed Q-Line %s (set by %s %ld seconds ago)",this->nick,this->source,this->duration);
 }
 
 void ZLine::DisplayExpiry()
 {
-       ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed Z-Line %s (set by %s %d seconds ago)",this->ipaddr,this->source,this->duration);
+       ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed Z-Line %s (set by %s %ld seconds ago)",this->ipaddr,this->source,this->duration);
 }
 
 void KLine::DisplayExpiry()
 {
-       ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed K-Line %s@%s (set by %s %d seconds ago)",this->identmask,this->hostmask,this->source,this->duration);
+       ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed K-Line %s@%s (set by %s %ld seconds ago)",this->identmask,this->hostmask,this->source,this->duration);
 }
 
 void GLine::DisplayExpiry()
 {
-       ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed G-Line %s@%s (set by %s %d seconds ago)",this->identmask,this->hostmask,this->source,this->duration);
+       ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed G-Line %s@%s (set by %s %ld seconds ago)",this->identmask,this->hostmask,this->source,this->duration);
 }
 
 const char* ELine::Displayable()
@@ -594,6 +600,11 @@ const char* QLine::Displayable()
        return nick;
 }
 
+bool KLine::IsBurstable()
+{
+       return false;
+}
+
 bool XLineManager::RegisterFactory(XLineFactory* xlf)
 {
        XLineFactMap::iterator n = line_factory.find(xlf->GetType());