diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-03-06 22:53:51 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-03-06 22:53:51 +0000 |
commit | 2ccf874d7e85c12278ee8ce24d750b0819eb2384 (patch) | |
tree | 5d00d191fe703a8a9d912de2d33aed276e286218 /src/modules/m_operjoin.cpp | |
parent | 3ed3241a5c38dde202deaa73204fecbe9d12d303 (diff) |
Fix on-rehash reloading of the lists... and why were we tokenizing the string on every connect/operup, when we should do it once on rehash? This makes it a ton faster.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6632 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_operjoin.cpp')
-rw-r--r-- | src/modules/m_operjoin.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/modules/m_operjoin.cpp b/src/modules/m_operjoin.cpp index 87e3aa380..09ddb47b9 100644 --- a/src/modules/m_operjoin.cpp +++ b/src/modules/m_operjoin.cpp @@ -22,6 +22,7 @@ class ModuleOperjoin : public Module { private: std::string operChan; + std::vector<std::string> operChans; ConfigReader* conf; @@ -51,6 +52,9 @@ class ModuleOperjoin : public Module conf = new ConfigReader(ServerInstance); operChan = conf->ReadValue("operjoin", "channel", 0); + operChans.clear(); + if (!operChan.empty()) + tokenize(operChan,operChans); } void Implements(char* List) @@ -62,6 +66,10 @@ class ModuleOperjoin : public Module { DELETE(conf); conf = new ConfigReader(ServerInstance); + operChan = conf->ReadValue("operjoin", "channel", 0); + operChans.clear(); + if (!operChan.empty()) + tokenize(operChan,operChans); } virtual ~ModuleOperjoin() @@ -79,15 +87,9 @@ class ModuleOperjoin : public Module if (!IS_LOCAL(user)) return; - if (!operChan.empty()) - { - std::vector<std::string> operChans; - tokenize(operChan,operChans); - for(std::vector<std::string>::iterator it = operChans.begin(); it != operChans.end(); it++) - if (ServerInstance->IsChannel(it->c_str())) - chanrec::JoinUser(ServerInstance, user, it->c_str(), false); - } - + for(std::vector<std::string>::iterator it = operChans.begin(); it != operChans.end(); it++) + if (ServerInstance->IsChannel(it->c_str())) + chanrec::JoinUser(ServerInstance, user, it->c_str(), false); } }; |