virtual void DisplayExpiry() = 0;
+ virtual const char* Displayable() = 0;
+
virtual void OnAdd() { }
/** The time the line was added.
virtual void DisplayExpiry();
+ virtual const char* Displayable();
+
/** Ident mask
*/
char* identmask;
virtual void DisplayExpiry();
+ virtual const char* Displayable();
+
/** Ident mask
*/
char* identmask;
virtual void OnAdd();
+ virtual const char* Displayable();
+
/** Ident mask
*/
char* identmask;
virtual void DisplayExpiry();
+ virtual const char* Displayable();
+
/** IP mask
*/
char* ipaddr;
virtual void DisplayExpiry();
+ virtual const char* Displayable();
+
/** Nickname mask
*/
char* nick;
class ServerConfig;
class InspIRCd;
-/** Done adding elines from the config
- */
-bool DoneELine(ServerConfig* conf, const char* tag);
-
/** Contains an ident and host split into two strings
*/
typedef std::pair<std::string, std::string> IdentHostPair;
/* Needs forward declaration */
bool ValidateDnsServer(ServerConfig* conf, const char* tag, const char* value, ValueItem &data);
+bool DoneELine(ServerConfig* conf, const char* tag);
ServerConfig::ServerConfig(InspIRCd* Instance) : ServerInstance(Instance)
{
return true;
}
+// this should probably be moved to configreader, but atm it relies on CheckELines above.
+bool DoneELine(ServerConfig* conf, const char* tag)
+{
+ for (std::vector<User*>::const_iterator u2 = conf->GetInstance()->local_users.begin(); u2 != conf->GetInstance()->local_users.end(); u2++)
+ {
+ User* u = (User*)(*u2);
+ u->exempt = false;
+ }
+
+ conf->GetInstance()->XLines->CheckELines(conf->GetInstance()->XLines->lookup_lines['E']);
+ return true;
+}
+
{
/*IdentHostPair ih = IdentSplit(hostmask);*/
- if (DelLine(hostmask, line->type, true))
+ if (DelLine(line->Displayable(), line->type, true))
return false;
/*ELine* item = new ELine(ServerInstance, ServerInstance->Time(), duration, source, reason, ih.first.c_str(), ih.second.c_str());*/
return ((match(str.c_str(), matchtext.c_str(), true)));
}
-virtual bool ELine::MatchesLiteral(const std::string &str)
+bool ELine::MatchesLiteral(const std::string &str)
{
- return (assign(str) == irc::string(this->identmask) + '@' + this->hostmask);
+ return (assign(str) == matchtext);
}
-virtual bool ZLine::MatchesLiteral(const std::string &str)
+bool ZLine::MatchesLiteral(const std::string &str)
{
return (assign(str) == this->ipmask);
}
-virtual bool GLine::MatchesLiteral(const std::string &str)
+bool GLine::MatchesLiteral(const std::string &str)
{
- return (assign(str) == irc::string(this->identmask) + '@' + this->hostmask);
+ return (assign(str) == matchtext);
}
-virtual bool KLine::MatchesLiteral(const std::string &str)
+bool KLine::MatchesLiteral(const std::string &str)
{
- return (assign(str) == irc::string(this->identmask) + '@' + this->hostmask);
+ return (assign(str) == matchtext);
}
-virtual bool QLine::MatchesLiteral(const std::string &str)
+bool QLine::MatchesLiteral(const std::string &str)
{
return (assign(str) == this->nickmask);
}
-virtual void ELine::OnAdd()
+void ELine::OnAdd()
{
ServerInstance->XLines->CheckELines(ServerInstance->XLines->lookup_lines['E']);
}
ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed G-Line %s@%s (set by %s %d seconds ago)",this->identmask,this->hostmask,this->source,this->duration);
}
+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;
+}
+
+const char* QLine::Displayable()
+{
+ return nickmask;
+}
+