-
- virtual void OnSyncChannel(Channel* chan, Module* proto, void* opaque)
- {
- /* NOTE: If +qa prefix is on, this is propagated by the channel join,
- * so we dont need to propagate it manually
- */
- if (!QAPrefixes)
- {
- // this is called when the server is linking into a net and wants to sync channel data.
- // we should send our mode changes for the channel here to ensure that other servers
- // know whos +q/+a on the channel.
- CUList* cl = chan->GetUsers();
- string_list commands;
- std::string founder = "cm_founder_"+std::string(chan->name);
- std::string protect = "cm_protect_"+std::string(chan->name);
- irc::modestacker modestack(true);
- std::deque<std::string> stackresult;
- for (CUList::iterator i = cl->begin(); i != cl->end(); i++)
- {
- if (i->first->GetExt(founder,dummyptr))
- {
- modestack.Push('q',i->first->nick);
- }
- if (i->first->GetExt(protect,dummyptr))
- {
- modestack.Push('a',i->first->nick);
- }
- }
- while (modestack.GetStackedLine(stackresult))
- {
- irc::stringjoiner mode_join(" ", stackresult, 0, stackresult.size() - 1);
- std::string line = mode_join.GetJoined();
- proto->ProtoSendMode(opaque,TYPE_CHANNEL,chan, line);
- }
- }
- }
-