summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2017-07-15 18:04:26 +0100
committerPeter Powell <petpow@saberuk.com>2017-09-11 16:01:17 +0100
commit6c6dbb427b693118b652aa01e6b4722fd5d2fb13 (patch)
treea94af9ba37e5c4348bc6a3aa0ff6d7dc6938bd2c /src
parent5fc4403f621ac93ef8a8c250b30436c0fea8f493 (diff)
Fix killing elined clients on [gkz]line in some cases.
Diffstat (limited to 'src')
-rw-r--r--src/inspircd.cpp5
-rw-r--r--src/xline.cpp11
2 files changed, 8 insertions, 8 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 0fa90fca5..66f9bfdc5 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -223,6 +223,11 @@ void InspIRCd::RehashUsersAndChans()
(**i).already_sent = 0;
(**i).RemoveExpiredInvites();
}
+
+ // HACK: ELines are not expired properly at the moment but it can't be fixed as
+ // the 2.0 XLine system is a spaghetti nightmare. Instead we skip over expired
+ // ELines in XLineManager::CheckELines() and expire them here instead.
+ ServerInstance->XLines->GetAll("E");
}
void InspIRCd::SetSignals()
diff --git a/src/xline.cpp b/src/xline.cpp
index 66d24f439..0506005ad 100644
--- a/src/xline.cpp
+++ b/src/xline.cpp
@@ -159,6 +159,7 @@ void XLineManager::CheckELines()
for (LocalUserList::const_iterator u2 = ServerInstance->Users->local_users.begin(); u2 != ServerInstance->Users->local_users.end(); u2++)
{
User* u = (User*)(*u2);
+ u->exempt = false;
/* This uses safe iteration to ensure that if a line expires here, it doenst trash the iterator */
LookupIter safei;
@@ -169,7 +170,8 @@ void XLineManager::CheckELines()
safei++;
XLine *e = i->second;
- u->exempt = e->Matches(u);
+ if ((!e->duration || ServerInstance->Time() < e->expiry) && e->Matches(u))
+ u->exempt = true;
i = safei;
}
@@ -325,13 +327,6 @@ 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 (LocalUserList::const_iterator u2 = ServerInstance->Users->local_users.begin(); u2 != ServerInstance->Users->local_users.end(); u2++)
- {
- User* u = (User*)(*u2);
- u->exempt = false;
- }
-
ServerInstance->XLines->CheckELines();
}