void RemoveMode(Channel* channel, char mc, irc::modestacker* stack) { CUList* cl = channel->GetUsers(); std::string item = extend + std::string(channel->name); std::vector<std::string> mode_junk; mode_junk.push_back(channel->name); irc::modestacker modestack(MyInstance, false); std::deque<std::string> stackresult; for (CUList::iterator i = cl->begin(); i != cl->end(); i++) { if (i->first->GetExt(item)) { if (stack) stack->Push(mc, i->first->nick); else modestack.Push(mc, i->first->nick); } } if (stack) return; while (modestack.GetStackedLine(stackresult)) { mode_junk.insert(mode_junk.end(), stackresult.begin(), stackresult.end()); MyInstance->SendMode(mode_junk, MyInstance->FakeClient); mode_junk.erase(mode_junk.begin() + 1, mode_junk.end()); } }
void RemoveMode(chanrec* channel, char mc) { unload_kludge = true; CUList* cl = channel->GetUsers(); std::string item = extend + std::string(channel->name); const char* mode_junk[MAXMODES+2]; 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->first->GetExt(item, dummyptr)) { modestack.Push(mc, i->first->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; }