summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-10-31 17:35:21 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-10-31 17:35:21 +0000
commit4c62b8741904a5908179e96b31ef1cf170c8564a (patch)
tree888deee70f90cbfa605fa0e1f03d7f334b0135ac /src
parent8fcac8d43807466858f7a2269ad4da540570d2b7 (diff)
More fixes and some optimizations
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8430 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/xline.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/xline.cpp b/src/xline.cpp
index 231152f25..75f689265 100644
--- a/src/xline.cpp
+++ b/src/xline.cpp
@@ -135,16 +135,12 @@ bool XLineManager::AddLine(XLine* line)
/*ELine* item = new ELine(ServerInstance, ServerInstance->Time(), duration, source, reason, ih.first.c_str(), ih.second.c_str());*/
- active_lines.push_back(item);
+ active_lines.push_back(line);
sort(active_lines.begin(), active_lines.end(), XLineManager::XSortComparison);
- lookup_lines[line->type][hostmask] = item;
+ lookup_lines[line->type][line->Displayable()] = line;
line->OnAdd();
- // XXX we really only need to check one line (the new one) - this is a bit wasteful!
- // we should really create a temporary var here and pass that instead.
- // hmm, perhaps we can merge this with line "application" somehow.. and just force a recheck on DelELine?
- /*this->CheckELines(lookup_lines['E']);
- return true;*/
+ return true;
}
/*bool XLineManager::AddZLine(long duration, const char* source, const char* reason, const char* ipaddr)
@@ -575,7 +571,7 @@ bool ELine::MatchesLiteral(const std::string &str)
bool ZLine::MatchesLiteral(const std::string &str)
{
- return (assign(str) == this->ipmask);
+ return (assign(str) == this->ipaddr);
}
bool GLine::MatchesLiteral(const std::string &str)
@@ -590,12 +586,18 @@ bool KLine::MatchesLiteral(const std::string &str)
bool QLine::MatchesLiteral(const std::string &str)
{
- return (assign(str) == this->nickmask);
+ return (assign(str) == this->nick);
}
void ELine::OnAdd()
{
- ServerInstance->XLines->CheckELines(ServerInstance->XLines->lookup_lines['E']);
+ /* 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++)
+ {
+ User* u = (User*)(*u2);
+ if (this->Matches(u))
+ u->exempt = true;
+ }
}
void ELine::DisplayExpiry()
@@ -645,6 +647,6 @@ const char* ZLine::Displayable()
const char* QLine::Displayable()
{
- return nickmask;
+ return nick;
}