diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-10-31 19:51:03 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-10-31 19:51:03 +0000 |
commit | c45fe6715d51a0b6565fee1321c45645883fa749 (patch) | |
tree | d34b69ddd88b2e7adda462b5e5e73455b60b3b91 /src/xline.cpp | |
parent | b3f562c11d5429fc555b75ae2ac491fa2b4dc72d (diff) |
Fix up to pass User*
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8442 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/xline.cpp')
-rw-r--r-- | src/xline.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/xline.cpp b/src/xline.cpp index 1f2782c4d..9d0b12fa3 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -126,20 +126,23 @@ IdentHostPair XLineManager::IdentSplit(const std::string &ident_and_host) // adds a g:line /*bool XLineManager::AddELine(long duration, const char* source, const char* reason, const char* hostmask)*/ -bool XLineManager::AddLine(XLine* line) +bool XLineManager::AddLine(XLine* line, User* user) { /*IdentHostPair ih = IdentSplit(hostmask);*/ - if (DelLine(line->Displayable(), line->type, true)) + if (DelLine(line->Displayable(), line->type, user, true)) return false; /*ELine* item = new ELine(ServerInstance, ServerInstance->Time(), duration, source, reason, ih.first.c_str(), ih.second.c_str());*/ active_lines.push_back(line); sort(active_lines.begin(), active_lines.end(), XLineManager::XSortComparison); + pending_lines.push_back(line); lookup_lines[line->type][line->Displayable()] = line; line->OnAdd(); + FOREACH_MOD(I_OnAddLine,OnAddLine(user, line)); + return true; } @@ -154,7 +157,7 @@ bool XLineManager::AddLine(XLine* line) // deletes a g:line, returns true if the line existed and was removed -bool XLineManager::DelLine(const char* hostmask, char type, bool simulate) +bool XLineManager::DelLine(const char* hostmask, char type, User* user, bool simulate) { IdentHostPair ih = IdentSplit(hostmask); for (std::vector<XLine*>::iterator i = active_lines.begin(); i != active_lines.end(); i++) @@ -170,7 +173,12 @@ bool XLineManager::DelLine(const char* hostmask, char type, bool simulate) active_lines.erase(i); if (lookup_lines.find(type) != lookup_lines.end()) lookup_lines[type].erase(hostmask); - /* XXX: Should erase from pending lines here */ + + FOREACH_MOD(I_OnDelLine,OnDelLine(user, *i)); + + std::vector<XLine*>::iterator pptr = std::find(pending_lines.begin(), pending_lines.end(), *i); + if (pptr != pending_lines.end()) + pending_lines.erase(pptr); } return true; } |