- Srv->SendTo(NULL, user, checkstr + " modes " + chanmodes(targchan, true));
- Srv->SendTo(NULL, user, checkstr + " usercount " + ConvToStr(targchan->GetUserCounter()));
+ user->WriteServ(checkstr + " modes " + targchan->ChanModes(true));
+ user->WriteServ(checkstr + " membercount " + ConvToStr(targchan->GetUserCounter()));
+
+ /* now the ugly bit, spool current members of a channel. :| */
+
+ CUList *ulist= targchan->GetUsers();
+
+ /* note that unlike /names, we do NOT check +i vs in the channel */
+ for (CUList::iterator i = ulist->begin(); i != ulist->end(); i++)
+ {
+ char tmpbuf[MAXBUF];
+ /*
+ * Unlike Asuka, I define a clone as coming from the same host. --w00t
+ */
+ snprintf(tmpbuf, MAXBUF, "%lu %s%s (%s@%s) %s ", ServerInstance->Users->GlobalCloneCount(i->first), targchan->GetAllPrefixChars(i->first), i->first->nick.c_str(), i->first->ident.c_str(), i->first->dhost.c_str(), i->first->fullname.c_str());
+ user->WriteServ(checkstr + " member " + tmpbuf);
+ }