summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/xline.h2
-rw-r--r--src/xline.cpp8
2 files changed, 9 insertions, 1 deletions
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();