diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-03-27 21:19:18 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-03-27 21:19:18 +0000 |
commit | 2f07f35dfdfa6f9c5432d37a21c6b53c6468ace2 (patch) | |
tree | a97ed73b2d1fa6a75a6b769ed162d632afccb1a5 /src/inspircd.cpp | |
parent | 47e253a51e60ef849deddec849e18cdb952dfbc2 (diff) |
Fixed 005 numeric to only output 13 tokens per line (thanks anfl)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@923 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r-- | src/inspircd.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 9d3addf1b..6fd3ab500 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -2407,7 +2407,24 @@ void ConnectUser(userrec *user) v << std::string(Network); std::string data005 = v.str(); FOREACH_MOD On005Numeric(data005); - WriteServ(user->fd,"005 %s %s :are supported by this server",user->nick,data005.c_str()); + // anfl @ #ratbox, efnet reminded me that according to the RFC this cant contain more than 13 tokens per line... + // so i'd better split it :) + std::stringstream out(data005); + std::string token = ""; + std::string line5 = ""; + int token_counter = 0; + while (!out.eof()) + { + out >> token; + line5 = line5 + token + " "; + token_counter++; + if ((token_counter >= 13) || (out.eof() == true)) + { + WriteServ(user->fd,"005 %s %s:are supported by this server",user->nick,line5.c_str()); + line5 = ""; + token_counter = 0; + } + } ShowMOTD(user); FOREACH_MOD OnUserConnect(user); WriteOpers("*** Client connecting on port %d: %s!%s@%s [%s]",user->port,user->nick,user->ident,user->host,user->ip); |