diff options
Diffstat (limited to 'src/configreader.cpp')
-rw-r--r-- | src/configreader.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
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<std::string>::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); |