- std::string extrastuff = items2.GetToken();
-
- new_parameters[splithere] = item.c_str();
- new_parameters[extra] = extrastuff.c_str();
-
- CommandObj->Handle(new_parameters,pcnt,user);
-
- dupes[item.c_str()] = true;
- }
- }
- return 1;
-}
-
-int CommandParser::LoopCall(userrec* user, command_t* CommandObj, const char** parameters, int pcnt, unsigned int splithere)
-{
- /* First check if we have more than one item in the list, if we don't we return zero here and the handler
- * which called us just carries on as it was.
- */
- if (!strchr(parameters[splithere],','))
- return 0;
-
- std::map<irc::string, bool> dupes;
-
- /* Only one commasepstream here */
- irc::commasepstream items1(parameters[splithere]);
- std::string item = "*";
- unsigned int max = 0;
-
- /* Parse the commasepstream until there are no tokens remaining.
- * Each token we parse out, call the command handler that called us
- * with it
- */
- while (((item = items1.GetToken()) != "") && (max++ < ServerInstance->Config->MaxTargets))
- {
- if (dupes.find(item.c_str()) == dupes.end())
- {
- const char* new_parameters[127];
-
- for (int t = 0; (t < pcnt) && (t < 127); t++)
- new_parameters[t] = parameters[t];
-
- new_parameters[splithere] = item.c_str();
-
- parameters[splithere] = item.c_str();
-
- /* Execute the command handler over and over. If someone pulls our user
- * record out from under us (e.g. if we /kill a comma sep list, and we're
- * in that list ourselves) abort if we're gone.
- */
- CommandObj->Handle(new_parameters,pcnt,user);
-
- dupes[item.c_str()] = true;
- }
- }
- /* By returning 1 we tell our caller that nothing is to be done,
- * as all the previous calls handled the data. This makes the parent
- * return without doing any processing.
- */
- return 1;
-}
-
-bool CommandParser::IsValidCommand(const std::string &commandname, int pcnt, userrec * user)
-{
- command_table::iterator n = cmdlist.find(commandname);