1
0
mirror of https://github.com/anope/anope.git synced 2026-07-07 02:03:15 +02:00

Made access del and xop del behave like access add/xop add by using a users mask if given an unregistered nick

This commit is contained in:
Adam
2012-11-09 19:20:17 -05:00
parent ff3e396e92
commit 8f36f65f39
2 changed files with 26 additions and 2 deletions
+13 -1
View File
@@ -186,7 +186,19 @@ class CommandCSAccess : public Command
void DoDel(CommandSource &source, ChannelInfo *ci, const std::vector<Anope::string> &params)
{
const Anope::string &mask = params[2];
Anope::string mask = params[2];
if (mask.find_first_of("!*@") == Anope::string::npos && !findnick(mask))
{
User *targ = finduser(mask);
if (targ != NULL)
mask = "*!*@" + targ->GetDisplayedHost();
else
{
source.Reply(NICK_X_NOT_REGISTERED, mask.c_str());
return;
}
}
if (!ci->GetAccessCount())
source.Reply(_("%s access list is empty."), ci->name.c_str());
+13 -1
View File
@@ -291,7 +291,7 @@ class XOPBase : public Command
void DoDel(CommandSource &source, ChannelInfo *ci, const std::vector<Anope::string> &params, XOPType level)
{
NickCore *nc = source.nc;
const Anope::string &mask = params.size() > 2 ? params[2] : "";
Anope::string mask = params.size() > 2 ? params[2] : "";
if (mask.empty())
{
@@ -319,6 +319,18 @@ class XOPBase : public Command
const ChanAccess *highest = access.Highest();
bool override = false;
if (mask.find_first_of("!*@") == Anope::string::npos && !findnick(mask))
{
User *targ = finduser(mask);
if (targ != NULL)
mask = "*!*@" + targ->GetDisplayedHost();
else
{
source.Reply(NICK_X_NOT_REGISTERED, mask.c_str());
return;
}
}
if ((!mask.equals_ci(nc->display) && !access.HasPriv("ACCESS_CHANGE") && !access.Founder) || ((!highest || tmp_access >= *highest) && !access.Founder))
{
if (source.HasPriv("chanserv/access/modify"))