+ var = "$";
+ var.append(ConvToStr(v));
+ x = newline.find(var);
+
+ while (x != std::string::npos)
+ {
+ newline.erase(x, var.length());
+ newline.insert(x, GetVar(var, original_line));
+ x = newline.find(var);
+ }
+ }
+
+ /* Special variables */
+ SearchAndReplace(newline, "$nick", user->nick);
+ SearchAndReplace(newline, "$ident", user->ident);
+ SearchAndReplace(newline, "$host", user->host);
+ SearchAndReplace(newline, "$vhost", user->dhost);
+
+ /* Unescape any variable names in the user text before sending */
+ SearchAndReplace(newline, "\r", "$");
+
+ irc::tokenstream ss(newline);
+ const char* parv[MAXPARAMETERS];
+ int x = 0;
+
+ while (ss.GetToken(pars[x]) && x < MAXPARAMETERS)
+ {
+ parv[x] = pars[x].c_str();
+ x++;
+ }
+
+ ServerInstance->Parser->CallHandler(parv[0], &parv[1], x-1, user);