- WriteServ(user->fd,"311 %s %s %s %s * :%s",user->nick, dest->nick, dest->ident, dest->dhost, dest->fullname);
- if ((user == dest) || (strchr(user->modes,'o')))
- {
- WriteServ(user->fd,"378 %s %s :is connecting from *@%s %s",user->nick, dest->nick, dest->host, dest->ip);
- }
- std::string cl = chlist(dest,user);
- if (cl.length())
- {
- if (cl.length() > 400)
- {
- split_chlist(user,dest,cl);
- }
- else
- {
- WriteServ(user->fd,"319 %s %s :%s",user->nick, dest->nick, cl.c_str());
- }
- }
- WriteServ(user->fd,"312 %s %s %s :%s",user->nick, dest->nick, dest->server, GetServerDescription(dest->server).c_str());
- if (*dest->awaymsg)
+ length = (pos == std::string::npos) ? cl.length() : pos;
+
+ if (line.length() + length - start > 510)