1
0
mirror of https://github.com/anope/anope.git synced 2026-06-29 10:56:38 +02:00

Send replies from fantasy commands back to the channel, this will be expanded on later

This commit is contained in:
Adam
2010-11-24 21:40:56 -06:00
parent 37e02a3594
commit cb6ef574e3
154 changed files with 2428 additions and 2111 deletions
+11 -3
View File
@@ -99,11 +99,12 @@ void mod_run_cmd(BotInfo *bi, User *u, Command *c, const Anope::string &command,
if (MOD_RESULT == EVENT_STOP)
return;
ChannelInfo *ci = NULL;
if (params.size() > 0 && !c->HasFlag(CFLAG_STRIP_CHANNEL) && (bi == ChanServ || bi == BotServ))
{
if (ircdproto->IsChannelValid(params[0]))
{
ChannelInfo *ci = cs_findchan(params[0]);
ci = cs_findchan(params[0]);
if (ci)
{
if (ci->HasFlag(CI_FORBIDDEN) && !c->HasFlag(CFLAG_ALLOW_FORBIDDEN))
@@ -141,11 +142,18 @@ void mod_run_cmd(BotInfo *bi, User *u, Command *c, const Anope::string &command,
return;
}
CommandReturn ret = c->Execute(u, params);
CommandSource source;
source.u = u;
source.ci = ci;
source.owner = bi;
source.service = fantasy && ci ? ci->bi : c->service;
source.fantasy = fantasy;
CommandReturn ret = c->Execute(source, params);
if (ret == MOD_CONT)
{
FOREACH_MOD(I_OnPostCommand, OnPostCommand(u, c->service, c->name, params));
FOREACH_MOD(I_OnPostCommand, OnPostCommand(source, c, params));
}
}