1
0
mirror of https://github.com/anope/anope.git synced 2026-07-01 12:26:39 +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
+12 -10
View File
@@ -20,16 +20,17 @@ class CommandCSInvite : public Command
{
}
CommandReturn Execute(User *u, const std::vector<Anope::string> &params)
CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> &params)
{
Anope::string chan = params[0];
Channel *c;
ChannelInfo *ci;
User *u2;
const Anope::string &chan = params[0];
User *u = source.u;
ChannelInfo *ci = source.ci;
Channel *c = ci->c;
if (!(c = findchan(chan)))
{
u->SendMessage(ChanServ, CHAN_X_NOT_IN_USE, chan.c_str());
source.Reply(CHAN_X_NOT_IN_USE, chan.c_str());
return MOD_CONT;
}
@@ -37,17 +38,18 @@ class CommandCSInvite : public Command
if (!check_access(u, ci, CA_INVITE))
{
u->SendMessage(ChanServ, ACCESS_DENIED);
source.Reply(ACCESS_DENIED);
return MOD_CONT;
}
User *u2;
if (params.size() == 1)
u2 = u;
else
{
if (!(u2 = finduser(params[1])))
{
u->SendMessage(ChanServ, NICK_X_NOT_IN_USE, params[1].c_str());
source.Reply(NICK_X_NOT_IN_USE, params[1].c_str());
return MOD_CONT;
}
}
@@ -56,11 +58,11 @@ class CommandCSInvite : public Command
Log(LOG_COMMAND, u, this, ci) << "for " << u2->nick;
if (c->FindUser(u2))
u->SendMessage(ChanServ, CHAN_INVITE_ALREADY_IN, c->name.c_str());
source.Reply(CHAN_INVITE_ALREADY_IN, c->name.c_str());
else
{
ircdproto->SendInvite(whosends(ci), chan, u2->nick);
u->SendMessage(whosends(ci), CHAN_INVITE_OTHER_SUCCESS, u2->nick.c_str(), c->name.c_str());
source.Reply(CHAN_INVITE_OTHER_SUCCESS, u2->nick.c_str(), c->name.c_str());
u2->SendMessage(whosends(ci), CHAN_INVITE_SUCCESS, c->name.c_str());
}
return MOD_CONT;