diff options
| author | 2018-09-21 20:54:05 +0100 | |
|---|---|---|
| committer | 2018-09-23 13:35:15 +0100 | |
| commit | 876b1ae4e280e99f24d37da4b819f108ddb3f1e3 (patch) | |
| tree | f1449e0b93da7ecd6e4d233a48befd4cef4e9ec4 /src/xline.cpp | |
| parent | Make kicknorejoin respect /INVITE (#1514). (diff) | |
Don't sync xlines defined in the config and expire them on rehash.
Closes #1427.
Diffstat (limited to 'src/xline.cpp')
| -rw-r--r-- | src/xline.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/xline.cpp b/src/xline.cpp index cb4f011c0..d07fe0dc5 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) @@ -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); + } + } + } +} |
