ModResult OnPreCommand(std::string &command, std::vector<std::string> ¶meters, LocalUser *user, bool validated, const std::string &original_line) CXX11_OVERRIDE
{
ModResult OnPreCommand(std::string &command, std::vector<std::string> ¶meters, LocalUser *user, bool validated, const std::string &original_line) CXX11_OVERRIDE
{
- i = Aliases.find(command);
- if (i == Aliases.end())
+ std::pair<AliasMap::iterator, AliasMap::iterator> iters = Aliases.equal_range(command);
+ if (iters.first == iters.second)
/* The parameters for the command in their original form, with the command stripped off */
std::string compare = original_line.substr(command.length());
while (*(compare.c_str()) == ' ')
compare.erase(compare.begin());
/* The parameters for the command in their original form, with the command stripped off */
std::string compare = original_line.substr(command.length());
while (*(compare.c_str()) == ' ')
compare.erase(compare.begin());
- AliasMap::iterator i = Aliases.find(scommand);
-
- if (i == Aliases.end())
+ std::pair<AliasMap::iterator, AliasMap::iterator> iters = Aliases.equal_range(scommand);
+ if (iters.first == iters.second)
/* The parameters for the command in their original form, with the command stripped off */
std::string compare = text.substr(scommand.length() + 1);
while (*(compare.c_str()) == ' ')
compare.erase(compare.begin());
/* The parameters for the command in their original form, with the command stripped off */
std::string compare = text.substr(scommand.length() + 1);
while (*(compare.c_str()) == ' ')
compare.erase(compare.begin());
if (DoAlias(user, c, &(i->second), compare, text.substr(1)))
return;
}
if (DoAlias(user, c, &(i->second), compare, text.substr(1)))
return;
}
}
}
int DoAlias(User *user, Channel *c, Alias *a, const std::string& compare, const std::string& safe)
{
}
}
int DoAlias(User *user, Channel *c, Alias *a, const std::string& compare, const std::string& safe)
{
{
ServerInstance->SNO->WriteToSnoMask('a', "NOTICE -- Service "+a->RequiredNick+" required by alias "+a->AliasedCommand+" is not on a u-lined server, possibly underhanded antics detected!");
user->WriteNumeric(ERR_NOSUCHNICK, a->RequiredNick + " :is an imposter! Please inform an IRC operator as soon as possible.");
{
ServerInstance->SNO->WriteToSnoMask('a', "NOTICE -- Service "+a->RequiredNick+" required by alias "+a->AliasedCommand+" is not on a u-lined server, possibly underhanded antics detected!");
user->WriteNumeric(ERR_NOSUCHNICK, a->RequiredNick + " :is an imposter! Please inform an IRC operator as soon as possible.");
std::string var = newline.substr(i, len);
result.append(GetVar(var, original_line));
i += len - 1;
}
std::string var = newline.substr(i, len);
result.append(GetVar(var, original_line));
i += len - 1;
}