aboutsummaryrefslogtreecommitdiffstats
path: root/src/configreader.cpp
diff options
context:
space:
mode:
authorGravatar brain2006-12-13 20:00:33 +0000
committerGravatar brain2006-12-13 20:00:33 +0000
commitf240285155d115ee3a0fd437944f2bec05a0c14c (patch)
treec5279b786faf023765a2b692b89bdc63b0716225 /src/configreader.cpp
parentProperly fix 'changed nickname from one thats on your notify to one thats not... (diff)
downloadinspircd++-f240285155d115ee3a0fd437944f2bec05a0c14c.tar.gz
inspircd++-f240285155d115ee3a0fd437944f2bec05a0c14c.tar.bz2
inspircd++-f240285155d115ee3a0fd437944f2bec05a0c14c.zip
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
Diffstat (limited to 'src/configreader.cpp')
-rw-r--r--src/configreader.cpp31
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);