- std::string buf;
- std::stringstream ss(ThisModes);
-
- std::vector<std::string> tokens;
-
- // split ThisUserModes into modes and mode params
- while (ss >> buf)
- tokens.push_back(buf);
-
- int size = tokens.size() + 1;
- const char** modes = new const char*[size];
- modes[0] = user->nick;
- modes[1] = tokens[0].c_str();
-
- if (tokens.size() > 1)
- {
- // process mode params
- int i = 2;
- for (unsigned int k = 1; k < tokens.size(); k++)
- {
- modes[i] = tokens[k].c_str();
- i++;
- }
- }
-
- ServerInstance->Parser->CallHandler("MODE", modes, size, user);
- delete [] modes;