+bool ELine::Matches(const std::string &str)
+{
+ return (InspIRCd::MatchCIDR(str, matchtext));
+}
+
+bool KLine::Matches(const std::string &str)
+{
+ return (InspIRCd::MatchCIDR(str.c_str(), matchtext));
+}
+
+bool GLine::Matches(const std::string &str)
+{
+ return (InspIRCd::MatchCIDR(str, matchtext));
+}
+
+void ELine::OnAdd()
+{
+ /* When adding one eline, only check the one eline */
+ for (std::vector<LocalUser*>::const_iterator u2 = ServerInstance->Users->local_users.begin(); u2 != ServerInstance->Users->local_users.end(); u2++)
+ {
+ User* u = (User*)(*u2);
+ if (this->Matches(u))
+ u->exempt = true;
+ }
+}
+
+void ELine::DisplayExpiry()
+{
+ ServerInstance->SNO->WriteToSnoMask('x',"Removing expired E-Line %s@%s (set by %s %ld seconds ago)",
+ identmask.c_str(),hostmask.c_str(),source.c_str(),(long)(ServerInstance->Time() - this->set_time));
+}
+
+void QLine::DisplayExpiry()
+{
+ ServerInstance->SNO->WriteToSnoMask('x',"Removing expired Q-Line %s (set by %s %ld seconds ago)",
+ nick.c_str(),source.c_str(),(long)(ServerInstance->Time() - this->set_time));
+}
+
+void ZLine::DisplayExpiry()
+{
+ ServerInstance->SNO->WriteToSnoMask('x',"Removing expired Z-Line %s (set by %s %ld seconds ago)",
+ ipaddr.c_str(),source.c_str(),(long)(ServerInstance->Time() - this->set_time));
+}
+
+void KLine::DisplayExpiry()
+{
+ ServerInstance->SNO->WriteToSnoMask('x',"Removing expired K-Line %s@%s (set by %s %ld seconds ago)",
+ identmask.c_str(),hostmask.c_str(),source.c_str(),(long)(ServerInstance->Time() - this->set_time));
+}
+
+void GLine::DisplayExpiry()
+{
+ ServerInstance->SNO->WriteToSnoMask('x',"Removing expired G-Line %s@%s (set by %s %ld seconds ago)",
+ identmask.c_str(),hostmask.c_str(),source.c_str(),(long)(ServerInstance->Time() - this->set_time));
+}
+
+const char* ELine::Displayable()
+{
+ return matchtext.c_str();
+}
+
+const char* KLine::Displayable()
+{
+ return matchtext.c_str();
+}
+
+const char* GLine::Displayable()
+{
+ return matchtext.c_str();
+}
+
+const char* ZLine::Displayable()
+{
+ return ipaddr.c_str();
+}
+
+const char* QLine::Displayable()
+{
+ return nick.c_str();
+}
+
+bool KLine::IsBurstable()
+{
+ return false;
+}
+
+bool XLineManager::RegisterFactory(XLineFactory* xlf)
+{
+ XLineFactMap::iterator n = line_factory.find(xlf->GetType());
+
+ if (n != line_factory.end())
+ return false;
+
+ line_factory[xlf->GetType()] = xlf;
+
+ return true;
+}
+
+bool XLineManager::UnregisterFactory(XLineFactory* xlf)
+{
+ XLineFactMap::iterator n = line_factory.find(xlf->GetType());
+
+ if (n == line_factory.end())
+ return false;
+
+ line_factory.erase(n);
+
+ return true;
+}
+
+XLineFactory* XLineManager::GetFactory(const std::string &type)
+{
+ XLineFactMap::iterator n = line_factory.find(type);
+
+ if (n == line_factory.end())
+ return NULL;
+
+ return n->second;
+}