bool AllowBots;
UserModeReference botmode;
+ // Whether we are actively executing an alias.
+ bool active;
+
public:
void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
{
return word;
}
- std::string CreateRFCMessage(const std::string& command, Command::Params& parameters)
+ std::string CreateRFCMessage(const std::string& command, CommandBase::Params& parameters)
{
std::string message(command);
for (CommandBase::Params::const_iterator iter = parameters.begin(); iter != parameters.end();)
{
- const std::string& parameter = *++iter;
+ const std::string& parameter = *iter++;
message.push_back(' ');
- if (iter == parameters.end())
+ if (iter == parameters.end() && (parameter.empty() || parameter.find(' ') != std::string::npos))
message.push_back(':');
message.append(parameter);
}
return MOD_RES_PASSTHRU;
}
+ ModResult OnUserPreMessage(User* user, const MessageTarget& target, MessageDetails& details) CXX11_OVERRIDE
+ {
+ // Don't echo anything which is caused by an alias.
+ if (active)
+ details.echo = false;
+
+ return MOD_RES_PASSTHRU;
+ }
+
void OnUserPostMessage(User* user, const MessageTarget& target, const MessageDetails& details) CXX11_OVERRIDE
{
if ((target.type != MessageTarget::TYPE_CHANNEL) || (details.type != MSG_PRIVMSG))
{
pars.push_back(token);
}
+
+ active = true;
ServerInstance->Parser.CallHandler(command, pars, user);
+ active = false;
}
void Prioritize() CXX11_OVERRIDE