]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/xline.cpp
Only try to parse the WebIRC IP if the user matches a host.
[user/henk/code/inspircd.git] / src / xline.cpp
index cb4f011c0fffa76f8c8caa90d01c474a2a93b34f..e0151b661ee3e4dabe620a092006b83045a39400 100644 (file)
@@ -518,7 +518,7 @@ void XLine::Apply(User* u)
 
 bool XLine::IsBurstable()
 {
-       return true;
+       return !from_config;
 }
 
 void XLine::DefaultApply(User* u, const std::string &line, bool bancache)
@@ -680,8 +680,8 @@ void ELine::OnAdd()
 void XLine::DisplayExpiry()
 {
        bool onechar = (type.length() == 1);
-       ServerInstance->SNO->WriteToSnoMask('x', "Removing expired %s%s %s (set by %s %ld seconds ago)",
-               type.c_str(), (onechar ? "-Line" : ""), Displayable().c_str(), source.c_str(), (long)(ServerInstance->Time() - set_time));
+       ServerInstance->SNO->WriteToSnoMask('x', "Removing expired %s%s %s (set by %s %ld seconds ago): %s",
+               type.c_str(), (onechar ? "-Line" : ""), Displayable().c_str(), source.c_str(), (long)(ServerInstance->Time() - set_time), reason.c_str());
 }
 
 const std::string& ELine::Displayable()
@@ -747,3 +747,24 @@ XLineFactory* XLineManager::GetFactory(const std::string &type)
 
        return n->second;
 }
+
+void XLineManager::ClearConfigLines()
+{
+       // Nothing to do.
+       if (lookup_lines.empty())
+               return;
+
+       ServerInstance->SNO->WriteToSnoMask('x', "Server rehashing; expiring lines defined in the server config ...");
+       for (ContainerIter type = lookup_lines.begin(); type != lookup_lines.end(); ++type)
+       {
+               for (LookupIter xline = type->second.begin(); xline != type->second.end(); )
+               {
+                       // We cache this to avoid iterator invalidation.
+                       LookupIter cachedxline = xline++;
+                       if (cachedxline->second->from_config)
+                       {
+                               ExpireLine(type, cachedxline);
+                       }
+               }
+       }
+}