diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-11-02 15:52:34 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-11-02 15:52:34 +0000 |
commit | ebbc4b3d54e3176d6c4c77493cb5cc0157b5c006 (patch) | |
tree | 0855c0eb3177bce0216558d8cd82b90621e226e8 | |
parent | 6c025fcb9e00e80c8279daa70ab4fde3c026e335 (diff) |
Expire timed glines that are due for expiry on stats request for it, thanks for the idea danieldg
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8464 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/xline.cpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/xline.cpp b/src/xline.cpp index 028067794..b41b69c89 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -275,25 +275,33 @@ void XLineManager::ApplyLines() pending_lines.clear(); } -/* k: 216 - * g: 223 - * q: 217 - * z: 223 - * e: 223 - */ - void XLineManager::InvokeStats(const std::string &type, int numeric, User* user, string_list &results) { std::string sn = ServerInstance->Config->ServerName; ContainerIter n = lookup_lines.find(type); + time_t current = ServerInstance->Time(); + + LookupIter safei; + if (n != lookup_lines.end()) { XLineLookup& list = n->second; - for (LookupIter i = list.begin(); i != list.end(); i++) - results.push_back(sn+" "+ConvToStr(numeric)+" "+user->nick+" :"+i->second->Displayable()+" "+ + for (LookupIter i = list.begin(); i != list.end(); ) + { + safei = i; + safei++; + + if (current > i->second->expiry) + { + ExpireLine(n, i); + } + else + results.push_back(sn+" "+ConvToStr(numeric)+" "+user->nick+" :"+i->second->Displayable()+" "+ ConvToStr(i->second->set_time)+" "+ConvToStr(i->second->duration)+" "+std::string(i->second->source)+" :"+(i->second->reason)); + i = safei; + } } } |