diff options
-rw-r--r-- | src/modules/m_conn_join.cpp | 20 | ||||
-rw-r--r-- | src/modules/m_operjoin.cpp | 20 |
2 files changed, 22 insertions, 18 deletions
diff --git a/src/modules/m_conn_join.cpp b/src/modules/m_conn_join.cpp index 6d5c607be..9a7fdca7a 100644 --- a/src/modules/m_conn_join.cpp +++ b/src/modules/m_conn_join.cpp @@ -23,6 +23,7 @@ class ModuleConnJoin : public Module private: std::string JoinChan; ConfigReader* conf; + std::vector<std::string> Joinchans; int tokenize(const string &str, std::vector<std::string> &tokens) @@ -50,6 +51,9 @@ class ModuleConnJoin : public Module { conf = new ConfigReader(ServerInstance); JoinChan = conf->ReadValue("autojoin", "channel", 0); + Joinchans.clear(); + if (!JoinChan.empty()) + tokenize(JoinChan,Joinchans); } void Implements(char* List) @@ -61,6 +65,10 @@ class ModuleConnJoin : public Module { DELETE(conf); conf = new ConfigReader(ServerInstance); + JoinChan = conf->ReadValue("autojoin", "channel", 0); + Joinchans.clear(); + if (!JoinChan.empty()) + tokenize(JoinChan,Joinchans); } virtual ~ModuleConnJoin() @@ -78,15 +86,9 @@ class ModuleConnJoin : public Module if (!IS_LOCAL(user)) return; - if (!JoinChan.empty()) - { - std::vector<std::string> Joinchans; - tokenize(JoinChan,Joinchans); - for(std::vector<std::string>::iterator it = Joinchans.begin(); it != Joinchans.end(); it++) - if (ServerInstance->IsChannel(it->c_str())) - chanrec::JoinUser(ServerInstance, user, it->c_str(), false); - } - + for(std::vector<std::string>::iterator it = Joinchans.begin(); it != Joinchans.end(); it++) + if (ServerInstance->IsChannel(it->c_str())) + chanrec::JoinUser(ServerInstance, user, it->c_str(), false); } }; 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); } }; |