X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_operjoin.cpp;h=21f9aae30815c48e18b50bff5318550a4429ada3;hb=bc344671460c1675fbc31504fd1ffc03ff58a135;hp=be12b6be19815ea729da2b82ee12c658a1b908a7;hpb=e4acbc95b8b6cd5b28d38a2242c02e8ff4991e4a;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_operjoin.cpp b/src/modules/m_operjoin.cpp index be12b6be1..21f9aae30 100644 --- a/src/modules/m_operjoin.cpp +++ b/src/modules/m_operjoin.cpp @@ -19,16 +19,17 @@ class ModuleOperjoin : public Module { private: std::string operChan; - std::vector operChans; + std::vector operChans; + bool override; - int tokenize(const string &str, std::vector &tokens) + int tokenize(const std::string &str, std::vector &tokens) { // skip delimiters at beginning. - string::size_type lastPos = str.find_first_not_of(",", 0); + std::string::size_type lastPos = str.find_first_not_of(",", 0); // find first "non-delimiter". - string::size_type pos = str.find_first_of(",", lastPos); + std::string::size_type pos = str.find_first_of(",", lastPos); - while (string::npos != pos || string::npos != lastPos) + while (std::string::npos != pos || std::string::npos != lastPos) { // found a token, add it to the vector. tokens.push_back(str.substr(lastPos, pos - lastPos)); @@ -52,8 +53,9 @@ class ModuleOperjoin : public Module virtual void OnRehash(User* user, const std::string ¶meter) { ConfigReader* conf = new ConfigReader(ServerInstance); - + operChan = conf->ReadValue("operjoin", "channel", 0); + override = conf->ReadFlag("operjoin", "override", "0", 0); operChans.clear(); if (!operChan.empty()) tokenize(operChan,operChans); @@ -67,7 +69,7 @@ class ModuleOperjoin : public Module virtual Version GetVersion() { - return Version(1,1,0,1,VF_VENDOR,API_VERSION); + return Version(1,2,0,1,VF_VENDOR,API_VERSION); } virtual void OnPostOper(User* user, const std::string &opertype, const std::string &opername) @@ -77,7 +79,7 @@ class ModuleOperjoin : public Module for(std::vector::iterator it = operChans.begin(); it != operChans.end(); it++) if (ServerInstance->IsChannel(it->c_str())) - Channel::JoinUser(ServerInstance, user, it->c_str(), false, "", false, ServerInstance->Time(true)); + Channel::JoinUser(ServerInstance, user, it->c_str(), override, "", false, ServerInstance->Time()); } };