From f240285155d115ee3a0fd437944f2bec05a0c14c Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 13 Dec 2006 20:00:33 +0000 Subject: Improve the way 005 ISUPPORT is sent to users when they connect, cache it in a much more sane format which is much simpler to spool to them git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5978 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/configreader.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'src/configreader.cpp') diff --git a/src/configreader.cpp b/src/configreader.cpp index b0106eb5e..bcf47eb03 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -115,6 +115,37 @@ bool ServerConfig::DelIOHook(InspSocket* is) return false; } +void ServerConfig::Update005() +{ + std::stringstream out(data005); + std::string token; + std::string line5; + int token_counter = 0; + isupport.clear(); + while (out >> token) + { + line5 = line5 + token + " "; + token_counter++; + if (token_counter >= 13) + { + char buf[MAXBUF]; + snprintf(buf, MAXBUF, "%s:are supported by this server", line5.c_str()); + isupport.push_back(buf); + line5 = ""; + token_counter = 0; + } + } + char buf[MAXBUF]; + snprintf(buf, MAXBUF, "%s:are supported by this server", line5.c_str()); + isupport.push_back(buf); +} + +void ServerConfig::Send005(userrec* user) +{ + for (std::vector::iterator line = ServerInstance->Config->isupport.begin(); line != ServerInstance->Config->isupport.end(); line++) + user->WriteServ("005 %s %s", user->nick, line->c_str()); +} + bool ServerConfig::CheckOnce(char* tag, bool bail, userrec* user) { int count = ConfValueEnum(this->config_data, tag); -- cgit v1.3.1-10-gc9f91