diff options
| author | 2012-12-05 19:59:34 +0100 | |
|---|---|---|
| committer | 2012-12-05 21:47:54 +0100 | |
| commit | 850563d175e29ddcc90472dfee6fd9b261a5dc40 (patch) | |
| tree | 728a228f942a73e1285277c1836b9e9ec72052b4 /src/xline.cpp | |
| parent | Unbreak m_geoip (diff) | |
Fix expired xlines being treated as live ones in XLineManager::AddLine()
This fixes ADDLINEs not being propagated and /gline etc. failing for already existing but expired xlines
Special thanks to @JDowny (TinMan) for his detailed report and cooperation that made this fix possible
Fixes #306 reported by @TurkDesk
Fixes #379 reported by @JDowny
Diffstat (limited to 'src/xline.cpp')
| -rw-r--r-- | src/xline.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/xline.cpp b/src/xline.cpp index 6501a7f6d..66d24f439 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -262,7 +262,12 @@ bool XLineManager::AddLine(XLine* line, User* user) LookupIter i = x->second.find(line->Displayable()); if (i != x->second.end()) { - return false; + // XLine propagation bug was here, if the line to be added already exists and + // it's expired then expire it and add the new one instead of returning false + if ((!i->second->duration) || (ServerInstance->Time() < i->second->expiry)) + return false; + + ExpireLine(x, i); } } |
