mirror of
https://github.com/anope/anope.git
synced 2026-07-04 05:53:12 +02:00
Send replies from fantasy commands back to the channel, this will be expanded on later
This commit is contained in:
@@ -20,7 +20,7 @@ class CommandNSAList : public Command
|
||||
{
|
||||
}
|
||||
|
||||
CommandReturn Execute(User *u, const std::vector<Anope::string> ¶ms)
|
||||
CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> ¶ms)
|
||||
{
|
||||
/*
|
||||
* List the channels that the given nickname has access on
|
||||
@@ -31,8 +31,8 @@ class CommandNSAList : public Command
|
||||
* -jester
|
||||
*/
|
||||
|
||||
User *u = source.u;
|
||||
Anope::string nick;
|
||||
|
||||
NickAlias *na;
|
||||
|
||||
int min_level = 0;
|
||||
@@ -77,18 +77,18 @@ class CommandNSAList : public Command
|
||||
}
|
||||
|
||||
if (!na)
|
||||
u->SendMessage(NickServ, NICK_X_NOT_REGISTERED, nick.c_str());
|
||||
source.Reply(NICK_X_NOT_REGISTERED, nick.c_str());
|
||||
else if (na->HasFlag(NS_FORBIDDEN))
|
||||
u->SendMessage(NickServ, NICK_X_FORBIDDEN, na->nick.c_str());
|
||||
source.Reply(NICK_X_FORBIDDEN, na->nick.c_str());
|
||||
else if (min_level <= ACCESS_INVALID || min_level > ACCESS_FOUNDER)
|
||||
u->SendMessage(NickServ, CHAN_ACCESS_LEVEL_RANGE, ACCESS_INVALID + 1, ACCESS_FOUNDER - 1);
|
||||
source.Reply(CHAN_ACCESS_LEVEL_RANGE, ACCESS_INVALID + 1, ACCESS_FOUNDER - 1);
|
||||
else
|
||||
{
|
||||
int level;
|
||||
int chan_count = 0;
|
||||
int match_count = 0;
|
||||
|
||||
u->SendMessage(NickServ, is_servadmin ? NICK_ALIST_HEADER_X : NICK_ALIST_HEADER, na->nick.c_str());
|
||||
source.Reply(is_servadmin ? NICK_ALIST_HEADER_X : NICK_ALIST_HEADER, na->nick.c_str());
|
||||
|
||||
for (registered_channel_map::const_iterator it = RegisteredChannelList.begin(), it_end = RegisteredChannelList.end(); it != it_end; ++it)
|
||||
{
|
||||
@@ -107,14 +107,14 @@ class CommandNSAList : public Command
|
||||
{
|
||||
Anope::string xop = get_xop_level(level);
|
||||
|
||||
u->SendMessage(NickServ, NICK_ALIST_XOP_FORMAT, match_count, ci->HasFlag(CI_NO_EXPIRE) ? '!' : ' ', ci->name.c_str(), xop.c_str(), !ci->desc.empty() ? ci->desc.c_str() : "");
|
||||
source.Reply(NICK_ALIST_XOP_FORMAT, match_count, ci->HasFlag(CI_NO_EXPIRE) ? '!' : ' ', ci->name.c_str(), xop.c_str(), !ci->desc.empty() ? ci->desc.c_str() : "");
|
||||
}
|
||||
else
|
||||
u->SendMessage(NickServ, NICK_ALIST_ACCESS_FORMAT, match_count, ci->HasFlag(CI_NO_EXPIRE) ? '!' : ' ', ci->name.c_str(), level, !ci->desc.empty() ? ci->desc.c_str() : "");
|
||||
source.Reply(NICK_ALIST_ACCESS_FORMAT, match_count, ci->HasFlag(CI_NO_EXPIRE) ? '!' : ' ', ci->name.c_str(), level, !ci->desc.empty() ? ci->desc.c_str() : "");
|
||||
}
|
||||
}
|
||||
|
||||
u->SendMessage(NickServ, NICK_ALIST_FOOTER, match_count, chan_count);
|
||||
source.Reply(NICK_ALIST_FOOTER, match_count, chan_count);
|
||||
}
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user