+ time_t creation_time = targchan->created;
+ time_t topic_time = targchan->topicset;
+
+ mytime = gmtime(&creation_time);
+ strftime(timebuf, 59, "%Y/%m/%d - %H:%M:%S", mytime);
+ user->WriteServ(checkstr + " created " + timebuf);
+
+ if (targchan->topic[0] != 0)
+ {
+ /* there is a topic, assume topic related information exists */
+ user->WriteServ(checkstr + " topic " + targchan->topic);
+ user->WriteServ(checkstr + " topic_setby " + targchan->setby);
+ mytime = gmtime(&topic_time);
+ strftime(timebuf, 59, "%Y/%m/%d - %H:%M:%S", mytime);
+ user->WriteServ(checkstr + " topic_setat " + timebuf);
+ }
+
+ 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 list[MAXBUF];
+ char tmpbuf[MAXBUF];
+ char* ptr = list;
+ int flags = targchan->GetStatusFlags(i->second);
+ /*
+ * find how many connections from this user's IP -- unlike Asuka,
+ * I define a clone as coming from the same host. --w00t
+ */
+ sprintf(ptr, "%lu ", i->second->GlobalCloneCount());
+
+ if (flags & UCMODE_OP)
+ {
+ strcat(ptr, "@");
+ }
+
+ if (flags & UCMODE_HOP)
+ {
+ strcat(ptr, "%");
+ }
+
+ if (flags & UCMODE_VOICE)
+ {
+ strcat(ptr, "+");
+ }
+
+ sprintf(tmpbuf, "%s (%s@%s) %s ", i->second->nick, i->second->ident, i->second->dhost, i->second->fullname);
+ strcat(ptr, tmpbuf);
+
+ user->WriteServ(checkstr + " member " + ptr);
+ }