From ef30d86d11696bb7ca639ae7a156a0c91d396cdb Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 7 Apr 2008 22:30:45 +0000 Subject: [PATCH] Add extra stuff for w00t, AutoApplyToUserList method for XLineFactory git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9409 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/xline.h | 2 ++ src/xline.cpp | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/xline.h b/include/xline.h index 2670f4bab..d1fe0e882 100644 --- a/include/xline.h +++ b/include/xline.h @@ -415,6 +415,8 @@ class CoreExport XLineFactory : public classbase */ virtual XLine* Generate(time_t set_time, long duration, const char* source, const char* reason, const char* xline_specific_mask) = 0; + virtual bool AutoApplyToUserList(XLine* x) { return true; } + /** Destructor */ virtual ~XLineFactory() { } diff --git a/src/xline.cpp b/src/xline.cpp index 7ce6c3f0a..c964ec962 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -158,7 +158,13 @@ bool XLineManager::AddLine(XLine* line, User* user) return false; /*ELine* item = new ELine(ServerInstance, ServerInstance->Time(), duration, source, reason, ih.first.c_str(), ih.second.c_str());*/ - pending_lines.push_back(line); + XLineFactory* xlf = GetFactory(line->type); + if (!xlf) + return false; + + if (xlf->AutoApplyToUserList(line)) + pending_lines.push_back(line); + lookup_lines[line->type][line->Displayable()] = line; line->OnAdd(); -- 2.39.5