X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fxline.cpp;h=e0151b661ee3e4dabe620a092006b83045a39400;hb=a77954b2181e5f20e951a0a09579dfcfe3905641;hp=cb4f011c0fffa76f8c8caa90d01c474a2a93b34f;hpb=b2ac8cc0a6405946a388b80df3be21bc276a61f3;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/xline.cpp b/src/xline.cpp index cb4f011c0..e0151b661 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -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); + } + } + } +}