- int tokenize(const string &str, std::vector<std::string> &tokens)
- {
- // skip delimiters at beginning.
- string::size_type lastPos = str.find_first_not_of(",", 0);
- // find first "non-delimiter".
- string::size_type pos = str.find_first_of(",", lastPos);
-
- while (string::npos != pos || string::npos != lastPos)
- {
- // found a token, add it to the vector.
- tokens.push_back(str.substr(lastPos, pos - lastPos));
- // skip delimiters. Note the "not_of"
- lastPos = str.find_first_not_of(",", pos);
- // find next "non-delimiter"
- pos = str.find_first_of(",", lastPos);
- }
- return tokens.size();
- }
-
- public:
- ModuleConnJoin(InspIRCd* Me)
- : Module(Me)
- {
- OnRehash(NULL, "");
- }
-
- void Prioritize()
- {
- ServerInstance->Modules->SetPriority(this, I_OnPostConnect, PRIO_LAST);
- }
-
- void Implements(char* List)
- {
- List[I_OnPostConnect] = List[I_OnRehash] = 1;
- }
+ while (chans.GetToken(chan))
+ {
+ if (ServerInstance->IsChannel(chan))
+ Channel::JoinUser(u, chan);
+ }
+}