* | Inspire Internet Relay Chat Daemon |
* +------------------------------------+
*
- * InspIRCd: (C) 2002-2008 InspIRCd Development Team
+ * InspIRCd: (C) 2002-2009 InspIRCd Development Team
* See: http://www.inspircd.org/wiki/index.php/Credits
*
* This program is free but copyrighted software; see
bool XLineManager::AddLine(XLine* line, User* user)
{
- /*IdentHostPair ih = IdentSplit(hostmask);*/
-
ServerInstance->BanCache->RemoveEntries(line->type, false); // XXX perhaps remove ELines here?
- if (DelLine(line->Displayable(), line->type, user, true))
- return false;
+ /* If the line exists, check if its an expired line */
+ ContainerIter x = lookup_lines.find(line->type);
+ if (x != lookup_lines.end())
+ {
+ LookupIter i = x->second.find(line->Displayable());
+ if (i != x->second.end())
+ {
+ if (i->second->duration && ServerInstance->Time() > i->second->expiry)
+ ExpireLine(x, i);
+ else
+ return false;
+ }
+ }
/*ELine* item = new ELine(ServerInstance, ServerInstance->Time(), duration, source, reason, ih.first.c_str(), ih.second.c_str());*/
XLineFactory* xlf = GetFactory(line->type);
if (u->exempt)
return false;
- if (InspIRCd::Match(u->ident, this->identmask))
+ if (InspIRCd::Match(u->ident, this->identmask, ascii_case_insensitive_map))
{
- if (InspIRCd::MatchCIDR(u->host, this->hostmask) ||
- InspIRCd::MatchCIDR(u->GetIPString(), this->hostmask))
+ if (InspIRCd::MatchCIDR(u->host, this->hostmask, ascii_case_insensitive_map) ||
+ InspIRCd::MatchCIDR(u->GetIPString(), this->hostmask, ascii_case_insensitive_map))
{
return true;
}
if (u->exempt)
return false;
- if (InspIRCd::Match(u->ident, this->identmask))
+ if (InspIRCd::Match(u->ident, this->identmask, ascii_case_insensitive_map))
{
- if (InspIRCd::MatchCIDR(u->host, this->hostmask) ||
- InspIRCd::MatchCIDR(u->GetIPString(), this->hostmask))
+ if (InspIRCd::MatchCIDR(u->host, this->hostmask, ascii_case_insensitive_map) ||
+ InspIRCd::MatchCIDR(u->GetIPString(), this->hostmask, ascii_case_insensitive_map))
{
return true;
}
if (u->exempt)
return false;
- if (InspIRCd::Match(u->ident, this->identmask))
+ if (InspIRCd::Match(u->ident, this->identmask, ascii_case_insensitive_map))
{
- if (InspIRCd::MatchCIDR(u->host, this->hostmask) ||
- InspIRCd::MatchCIDR(u->GetIPString(), this->hostmask))
+ if (InspIRCd::MatchCIDR(u->host, this->hostmask, ascii_case_insensitive_map) ||
+ InspIRCd::MatchCIDR(u->GetIPString(), this->hostmask, ascii_case_insensitive_map))
{
return true;
}
bool QLine::Matches(User *u)
{
- if (u->exempt)
- return false;
-
if (InspIRCd::Match(u->nick, this->nick))
return true;