diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-10-23 09:23:20 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-10-23 09:23:20 +0000 |
commit | afdf3e40768ba4c4c33b084b92cdcff335b94bbc (patch) | |
tree | 95c286993e9e18ce6b5376afe9f4a753a975c98d /src | |
parent | b0b809d0003099876ec8c89c939695ef00afe294 (diff) |
This needs TESTING: use modestacker when unloading module to group modes.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5531 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_chanprotect.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp index 89be44788..fff162178 100644 --- a/src/modules/m_chanprotect.cpp +++ b/src/modules/m_chanprotect.cpp @@ -77,19 +77,30 @@ class FounderProtectBase { unload_kludge = true; CUList* cl = channel->GetUsers(); - std::string item = extend+std::string(channel->name); - char moderemove[MAXBUF]; + std::string item = extend + std::string(channel->name); + const char* mode_junk[MAXMODES+1]; userrec* n = new userrec(MyInstance); n->SetFd(FD_MAGIC_NUMBER); + mode_junk[0] = channel->name; + irc::modestacker modestack(false); + std::deque<std::string> stackresult; for (CUList::iterator i = cl->begin(); i != cl->end(); i++) { if (i->second->GetExt(item, dummyptr)) { - sprintf(moderemove,"-%c",mc); - const char* parameters[] = { channel->name, moderemove, i->second->nick }; - MyInstance->SendMode(parameters, 3, n); + modestack.Push(mc, i->second->nick); } } + + while (modestack.GetStackedLine(stackresult)) + { + for (size_t j = 0; j < stackresult.size(); j++) + { + mode_junk[j+1] = stackresult[j].c_str(); + } + MyInstance->SendMode(mode_junk, stackresult.size() + 1, n); + } + delete n; unload_kludge = false; } |