+ context.Write("timestamp", timestring(targchan->age));
+
+ if (!targchan->topic.empty())
+ {
+ /* there is a topic, assume topic related information exists */
+ context.Write("topic", targchan->topic);
+ context.Write("topic_setby", targchan->setby);
+ context.Write("topic_setat", timestring(targchan->topicset));
+ }
+
+ context.Write("modes", targchan->ChanModes(true));
+ context.Write("membercount", ConvToStr(targchan->GetUserCounter()));
+
+ /* now the ugly bit, spool current members of a channel. :| */
+
+ const Channel::MemberMap& ulist = targchan->GetUsers();
+
+ /* note that unlike /names, we do NOT check +i vs in the channel */
+ for (Channel::MemberMap::const_iterator i = ulist.begin(); i != ulist.end(); ++i)
+ {
+ /*
+ * Unlike Asuka, I define a clone as coming from the same host. --w00t
+ */
+ const UserManager::CloneCounts& clonecount = ServerInstance->Users->GetCloneCounts(i->first);
+ context.Write("member", InspIRCd::Format("%-3u %s%s (%s@%s) %s ", clonecount.global,
+ i->second->GetAllPrefixChars(), i->first->nick.c_str(),
+ i->first->ident.c_str(), i->first->dhost.c_str(), i->first->fullname.c_str()));
+ }
+
+ const ModeParser::ListModeList& listmodes = ServerInstance->Modes->GetListModes();
+ for (ModeParser::ListModeList::const_iterator i = listmodes.begin(); i != listmodes.end(); ++i)
+ dumpListMode(context, (*i)->GetList(targchan));
+
+ dumpExt(context, targchan);