- std::stringstream channels(cl);
- std::string line = "";
- std::string cname = "";
- while (!channels.eof())
- {
- channels >> cname;
- line = line + cname + " ";
- if (line.length() > 400)
- {
- WriteServ(user->fd,"319 %s %s :%s",user->nick, dest->nick, line.c_str());
- line = "";
- }
- }
- if (line.length())
- {
- WriteServ(user->fd,"319 %s %s :%s",user->nick, dest->nick, line.c_str());
- }
-}
-
-/* XXX - perhaps this should be in cmd_whois? -- w00t */
-void do_whois(userrec* user, userrec* dest,unsigned long signon, unsigned long idle, char* nick)
-{
- // bug found by phidjit - were able to whois an incomplete connection if it had sent a NICK or USER
- if (dest->registered == 7)
+ std::string line;
+ std::ostringstream prefix;
+ std::string::size_type start, pos, length;
+
+ prefix << ":" << Config->ServerName << " 319 " << user->nick << " " << dest->nick << " :";
+ line = prefix.str();
+
+ for (start = 0; pos = cl.find(' ', start); start = pos+1)